Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Detailed memory dumps (leak hunting)

by Vennis (Pilgrim)
on Sep 24, 2002 at 11:58 UTC ( #200339=perlquestion: print w/replies, xml ) Need Help??

Vennis has asked for the wisdom of the Perl Monks concerning the following question:


Is there a module or method to dump the total memory usage of Perl and each of the loaded and used modules in detail? (including used variables, without having to name all the variables)

And in a way, that i can call several times on different occasions. I'm looking for a sort of memory-leak bug in a large script that includes lots of module usage.

(I tried Search but no answers that really satisfied me, so i ask my fellow monks.)

Q: Why did the Perlmonk cross the road?
A: He wanted to escape the match.

Replies are listed 'Best First'.
Re: Detailed memory dumps (leak hunting)
by janx (Monk) on Sep 24, 2002 at 12:27 UTC
      Maybe one of them can be helpful, thank you. I've seen them before, but i'm not sure if they will be giving me the information i need.

      This, because it might not be an unreclaimed object, most objects are consistant, but more of a forgotten re-initialised hash or something.

      So i thought, by determing the size of the objects at different times i can localize the memory-monster.

      I already wrote a global-variable-dump procedure that's useful in this case but i can't seem to determine the actual size of declared objects and used modules.

      Q: Why did the Perlmonk cross the road?
      A: He wanted to escape the match.

        Well if I were me (and I am) I'd write something that uses B to account for at least the visible stuff. If that didn't work then some handy dandy XS code could walk the internals. I'm of course assuming you have already read the note in perldebguts on "Debugging Perl memory usage" and you need more detail... (if you haven't then obviously this is where you go first)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://200339]
Approved by Snuggle
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2023-05-29 06:47 GMT
Find Nodes?
    Voting Booth?

    No recent polls found