We have Devel::DProf, which is quite nice for profiling time spent in
subroutines, but we appear to have nothing yet for profile memory
consumption in perl5.
I have a server process which forks to parallelize certain operations,
and if I create a huge data structure in the parent process, this
bloats the memory of the children as well.
I'm starting to wonder how to profile memory consumption in perl5.
The crudest approach would be to parse the symbol table, and sum up
the amount of space taken up by each item. The question is, what's
the correct way to do this??
I am interested primarily in tracing through a large complex data
structure (hash of hashes of hashes of hashes of....) and showing
(optimally in a tree structure) how much memory is consumed by each
"leaf" on the structure.
How much memory does a single hash reference consume?? If that is a
reference to a hash of hashes, how much space do thekeys take up?? I
am assuming I can use length() if the values are scalar, but if they
are numeric, are they stored internally in a different format??
Help and pointers much appreciated. Prior art would be nice...
W. Phillip Moore Phone: (212)-762-2433
Information Technology Department FAX: (212)-762-1009
Morgan Stanley and Co. E-mail: wpm@ms.com
750 7th Ave, NY, NY 10019
"Grant me the serenity to accept the things I cannot change, the
courage to change the things I can, and the wisdom to hide the
bodies of the people that I had to kill because they pissed me
off."
-- Anonymous
"Every normal man must be tempted at times to spit on his
hands, hoist the black flag, and begin slitting throats."
-- H.L. Mencken
subroutines, but we appear to have nothing yet for profile memory
consumption in perl5.
I have a server process which forks to parallelize certain operations,
and if I create a huge data structure in the parent process, this
bloats the memory of the children as well.
I'm starting to wonder how to profile memory consumption in perl5.
The crudest approach would be to parse the symbol table, and sum up
the amount of space taken up by each item. The question is, what's
the correct way to do this??
I am interested primarily in tracing through a large complex data
structure (hash of hashes of hashes of hashes of....) and showing
(optimally in a tree structure) how much memory is consumed by each
"leaf" on the structure.
How much memory does a single hash reference consume?? If that is a
reference to a hash of hashes, how much space do thekeys take up?? I
am assuming I can use length() if the values are scalar, but if they
are numeric, are they stored internally in a different format??
Help and pointers much appreciated. Prior art would be nice...
W. Phillip Moore Phone: (212)-762-2433
Information Technology Department FAX: (212)-762-1009
Morgan Stanley and Co. E-mail: wpm@ms.com
750 7th Ave, NY, NY 10019
"Grant me the serenity to accept the things I cannot change, the
courage to change the things I can, and the wisdom to hide the
bodies of the people that I had to kill because they pissed me
off."
-- Anonymous
"Every normal man must be tempted at times to spit on his
hands, hoist the black flag, and begin slitting throats."
-- H.L. Mencken