Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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



  • 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: (5)
As of 2024-04-24 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found