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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.