Hi,
I'm having a problem with a large perl program using up even larger amounts of memory. I've been trying to make sense of this by using
Devel::Size,
Devel::Symdump, but from this I learned that the symbol table contains only a small amount of the total memory the process is using (see
Devel::Symdump without Devel::Symdump interference, where I learned that the symbol table doesn't contain lexical scopes (
broquaint++)).
Since this post I've been trying to use
Padwalker to peek into the lexical scopes I'm in; not very succesfully because this seems to 'hang' when I'm using it in perl-d. The other problem with this is that (as far as I can see) it accesses only the scopes below the point-of-action of Padwalker, not all lexical scopes ('scratchpads') that might have variables or other beasts using up memory.
I've been reading up on the perlguts and related literature, and every variable is stored in a structure (like IV, SV, CV and friends), but I haven't encountered a lot of information on the 'superstructure' that keeps these values organised, and how to get information from this 'superstructure'.
Is there a way of breaking up the total memory-usage of a running perl process (or a core-dump) into variables/other managable units? Perl doesn't return memory that is freed after a variable/object etc. is destroyed. Is it possible to view how much of this 'allocated-unused' memory a running process is keeping occupied?
A lot of info can be found on CPU-usage statistics (ie. profiling), any pointers to memory-usage related info appreciated. If my view of how perl memory usage is organised is wrong, I'd like to know as well.
Update: Thanks a lot everybody for your replies, I've learned a lot from it. Thanks
gmpassos for pointing out
B::TerseSize.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.