I see this as an XY problem.. you have a problem with X (high memory), and decide to do Y (dump of all the data) to try and solve it... based on the false assumption that Y will actually help you solving X.

Many of the modules in the Devel:: category will help you "solving" Y: Devel::Peek will help you seeing the Dump() of every variable you use, showing you the exact data that Perl is using for it, such as showing you the value of the variable, the number of reference counts to it, the flags, etc.etc.

Instead, Devel::Size will tell you the exact memory allocated for each of the entitites (watch out for reference though:

my $ref = \$data; size($ref); # will give you the same size of $data my $ref = \$data; my $ref2 = \$ref; size($ref2); # will give you the s +ize of the reference itself

Somehow, I don't think that Devel::Peek or Devel::Size will help you much.

Now, off to solving X: have you tried using DProf and analysing where your code is spending its time? Are you using warnings/strict/diagnostic, and tried using hooks to the functions you think might cause the problem, via Hook::LexWrap? you can then wrap pieces of debugging code around any function, time it, check anything you want prior to and after the execution of any function..

Just my 0.01

In reply to Re: Getting a memory dump by okram
in thread 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.