I recently changed about a half dozen base class packages used by most of my code. When I rolled these out I found that my process size (Solaris) was growing at a pretty good clip. When I use the old versions this does not happen.

I can't find this for the life of me. There are two self references, managed via WeakRef. I've check both of these and they are not a problem. I've also used Devel::ObjectTracker and it finds nothing. I boiled my test case down to a loop that just creates a base class instance over and over again. The reference I get with each creation is identical -- I'd expect a new one if memory wasn't being freed. There are a handful of base data structures created once and modified by a base Class attribute package. I've checked those and can find no growth in them (I checked their arrays and hashes for iterative additions that might have been causing this).

Any ideas for other leak checkers? The new code makes heavier use of AUTOLOAD and does some functional goto's within there. In one case it sets a local value as part of that, but I systematically removed each of those and saw the same growth. Are there better tools or methods some monks might suggest using here? Or are there known leak areas in Perl (I'm using 5.6.1) that I'm not aware of?


In reply to Finding memory leaks by steves

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.