Java Mailing List Archive

http://www.apache-httpd.com/

Home » modperl.perl »

finding memory leaks

E R

2009-08-10

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi,

What's the best way to find memory leaks in a mod_perl app? I am
trying to use Apache::Leak with mod_perl 1.41

Some notes:

1. My mod_perl app is *HUGE*. Apache::Leak reports over 500,000 SVs. I
think the time it takes to traverse the symbol tables is long enough
to time out my browser (I'm seeing the output from what looks like a
second request or an error handler.)

2. Should I compile perl with any special options, like DEBUG?
Apache::Leak reports I am leaking ~50 SVs, and I see a lot of "old"
messages, but not a lot of other useful information to track down the
leakage.

3. I'm putting the leak detection code right around my handler
function (which I've renamed to 'real_handler')

sub handler {
my @args = @_;
my $response;
leak_test {
  $response = real_handler(@(protected));
};
$response;
}

sub real_handler { ... } # original handler routine

Any issues with that?

Thanks,

ER
©2008 apache-httpd.com - Jax Systems, LLC, U.S.A.