[Israel.pm] how much memory each Perl variable uses
offer.kaye at gmail.com
Thu Sep 10 05:24:44 PDT 2009
On Wed, Sep 9, 2009 at 1:46 PM, Amir E. Aharoni wrote:
> Is there any convenient tool which can produce a detailed list of all
> the memory usage of a Perl program during runtime?
The best advice I've seen about profiling memory usage is to use an
external tool called Valgrind which is supposed to be very good for
such work. There's a perlmonks thread which might help you with some
env settings. There's also a CPAN module called Test::Valgrind
and if you look at the "SEE ALSO" section in its pod you will see a
few other memory profiling options listed. Note the caveat, you'll
likely want to use a perl built with debugging enabled.
Apart from direct memory profiling, understanding where your code
spends the most time might also help. Hands down the best module for
that is Devel::NYTProf  - I would at least give it a try to see if
it brings up anything.
More information about the Perl