Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Date::Manip has a memory leak that I'm trying to track down, and I guess that I simply do not understand perl internals enough to understand what is causing the leak.

A trivial test script:
   #!/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 39
This 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.

The referenced line 39 in amnew_00.pm looks like:
   %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).

This code is used exactly once in Date::Manip::TZ:
   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.

I'll be happy to provide any additional information needed

In reply to Memory leak question by SBECK

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-24 22:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found