[OT] finding memory hungry bits of my code

peter@dragonstaff.com peter at dragonstaff.com
Thu Apr 9 14:36:53 BST 2009

Quoting Edmund von der Burg <edmund.vonderburg at gmail.com>:

> I don't think that it is a memory leak - the size tends to remain
> constant after a few requests (it's a webapp - Catalyst under
> mod_perl).

Run 'ab' against your app to check that is indeed the case.
More info at http://modperlbook.org/html/14-2-6-Memory-Leakage.html

Use Apache status monitoring configuration for more detailed data:  
Be aware that some of the memory usage shown per child is actually shared.
Make sure you're not loading any unnecessary modules into Apache.

Preload your Perl modules and DBIx::Class models in the Apache parent.  
The memory will become unshared over time so set MaxRequestsPerChild  
to force a reload.

You may also be able to save memory by running through FastCGI rather  
than Apache.

Regards, Peter

More information about the london.pm mailing list