This question has been asked on a few occasions in the past, most recently (that I can find) about three years ago. Actually, I am pretty surprised that there does not seem to be an answer along the lines of: "Oh yes, you do this ...".

Is there a way that I can get a complete heap dump of all application data from a Perl program, like an hprof dump from a Sun JVM? I realise that this might be a rather blunt instrument but sometimes sifting through the data is the best way to get to the bottom of a problem.

Why? I'm working on an application - a long-running server program - which, under poorly-defined circumstances, exhibits massive memory growth. This could be a 'leak' (as in a discarded circular reference chain) or it could just be uncontrolled growth of some data structure. The program is large and complex and written by many people and I have little clue which module(s) may be responsible. So picking through details of a dump seems like a good strategy; except that I cannot work out how to get such a dump.


In reply to Getting a memory dump by awy

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.