Profiling Perl app memory usage

Dirk Koopman djk at tobit.co.uk
Thu Feb 2 12:19:15 GMT 2006


On Thu, 2006-02-02 at 12:07 +0000, Nik Clayton wrote:
> Is anyone aware of anything that makes it easier to portably track a Perl
> app's memory usage?
> 
> I've been fixing http://rt.cpan.org/Ticket/Display.html?id=17359.  Since the
> problem was excessive memory use I needed to track down where in the app the
>   memory use dramatically increased.
> 
> I ended up littering the code with sections like this:
> 
>      warn "At point foo\n";
>      warn qx{ ps -o rss,vsz $$ }, "\n";
> 
> which (on FreeBSD at least) will print out the process' resident and virtual
> size at various points.
> 

<snip>

> Walking through CPAN modules that match /devel/i and /prof/i I can't see
> anything that can reliably extract this information.
> 

If you can tolerate Linux: how about valgrind and one of its coverage
tools?





More information about the london.pm mailing list