finding memory leaks

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 [at] args = [at] _;
my $response;
leak_test {
$response = real_handler( [at] args);
};
$response;
}

sub real_handler { ... } # original handler routine

Any issues with that?

Thanks,

ER
E R [ Mo, 10 August 2009 22:35 ] [ ID #2011636 ]

Re: finding memory leaks

On Mon, Aug 10, 2009 at 4:35 PM, E R<pc88mxer [at] gmail.com> wrote:
> What's the best way to find memory leaks in a mod_perl app?

What problem are you trying to solve? Is your app just growing? If
so, that's probably not a leak. You're most likely just using memory.
There are many tips for analyzing and reducing memory use, both in
the mod_perl docs and the book at http://modperlbook.org/.

- Perrin
Perrin Harkins [ Mo, 10 August 2009 22:39 ] [ ID #2011637 ]
Webserver » gmane.comp.apache.mod-perl » finding memory leaks

Vorheriges Thema: Is mod_perl dead?
Nächstes Thema: A lot of "segmentation fault", Ubuntu Hardy, apache with mod_perl