SBECK has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w
use Date::Manip::Date;
$date = new Date::Manip::Date;
use Devel::LeakTrace::Fast;
$date->parse("2010-02-01 01:02:03");
shows:
leaked SV(0x0x1241a80) from /home/sulbeck/local/lib/perl5/5.10.1/Date/Manip/TZ/amnew_00.pm line 39This is just one leak among many, but I figure if I can just understand one of them, I'll be able to figure out the others. There are a mixture of leaked AVs, SVs, and RVs if that matters all being reported at the same line 39.
%Dates = (
1 =>
[
[ 1,1,2,0,0,0,1,1,1,19,3,58,'-04:56:02',-4,-56,-2,
'LMT',0,1883,11,18,16,59,59,1883,11,18,12,3,57,
'0001010200:00:00','0001010119:03:58','1883111816:59:59','1883111812:03:57' ],
],
...
);
(there are a number of other hash elements too, but they are all of this format).
no strict 'refs';
...
my $mod = $$self{'data'}{'Module'}{$zone};
eval "require Date::Manip::TZ::${mod}";
my %dates = %{ "Date::Manip::TZ::${mod}::Dates" };
$$self{'data'}{'Zones'}{$zone} =
{
'Dates' => { %dates },
};
...
use strict 'refs';
There are no circular references at this point (in previous versions, there were, but in the development version I'm working on now, I've removed them). I can provide the development version to anyone who wishes it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Memory leak question
by BrowserUk (Patriarch) on Oct 04, 2010 at 19:40 UTC | |
by SBECK (Chaplain) on Oct 04, 2010 at 20:01 UTC | |
by BrowserUk (Patriarch) on Oct 04, 2010 at 20:12 UTC | |
by SBECK (Chaplain) on Oct 05, 2010 at 13:30 UTC | |
by BrowserUk (Patriarch) on Oct 05, 2010 at 15:18 UTC | |
|