Profiling Perl app memory usage

Dominic Mitchell dom at happygiraffe.net
Sat Feb 4 17:17:14 GMT 2006


Nik Clayton wrote:
> Phil Pennock suggested I look at BSD::Resource, which seems to be a good 
> fit.  Thanks Phil.
> 
> So, here's Devel::Memory.  It's very simple minded, and designed 
> (hardcoded) for SVN::Web at the moment.  I'd appreciate feedback on any 
> additional features that might make this useful (and a better name), as 
> well as suggestions for a good API.
> 
> Here's the commit that created it:
> 
>     http://jc.ngo.org.uk/svnweb/jc/revision?rev=781
> 
> You can check out the code from that link too.

Is there any chance that link could supply some HTTP headers as well as 
the body?  It's rather confusing to poor little Safari.  Firefox manages 
to display it ok, but that could just be luck.  :-)

> Usage is (assuming the directory is in @INC) just
> 
>     perl -d:Memory app-you-want-to-profile

It looks like a really good idea.  As to choosing the package name, the 
easy way is probably to use an environment variable.  You could also use 
import(), so you could say "perl -d:Memory=My::Package foo.pl".  Sample 
(untested) patch attached.

I do actually happen to quite like the name...

-Dom
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Memory.pm.patch
Url: http://london.pm.org/pipermail/london.pm/attachments/20060204/28fd81e0/Memory.pm.ksh


More information about the london.pm mailing list