You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Graham Leggett <mi...@sharp.fm> on 1999/05/28 12:50:41 UTC

Apache memory problems

Hi all,

A specific question about Apache and it's memory use.

My v1.3.7-dev installation's private memory usage slowly exands over
time, eventually overwhelming the box. The interesting part about this
is that the private memory footprint of *all* the httpd client processes
is roughly the same and grows at the same rate, which means that all the
httpd processes are leaking in the same way at the same time.

What part of the Apache code should I be looking in to fix this? Why
should all the httpd clients expand by the same amount of memory at the
same time? Can anyone offer any clues?

I am desperate for some kind of clue to the cause of this problem, I
have no idea where to even start looking.

Can anyone help?

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight...

Re: Apache memory problems

Posted by Graham Leggett <mi...@sharp.fm>.
Keith Wannamaker wrote:

> You probably don't have to look much farther than any third-party modules you're
> using in the installation.  I would spend a lot more time scrutinizing their
> code than Apache's.

I have two installations doing this, one with a third party module, and
the other with no third party modules at all. Both systems suffer the
leak.

With a lot of prodding and poking, it seems that I have come to have a
sort-of understanding as to what's going on with my strange errors. The
sequence of events goes like this:

- Something breaks the "graceful child terminate" procedure, so
processes start getting stuck.

- Over time, Apache spawns new processes to do the work of the "stuck"
ones.

- Eventually, MaxClients is reached. Either just before this point, or
just after, I'm not sure at this stage, Apache starts leaking memory all
over the place, eventually leaking enough to swamp the box.

I have got Dean Gaudet's patch to try fix the stuck process problem, I'm
going to give it a try, and if it works I am going to grin broadly and
get myself some really strong coffee.

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight...

Re: Apache memory problems

Posted by Keith Wannamaker <wa...@us.ibm.com>.
> What part of the Apache code should I be looking in to fix this? Why
> should all the httpd clients expand by the same amount of memory at the
> same time? Can anyone offer any clues?
> 
> I am desperate for some kind of clue to the cause of this problem, I
> have no idea where to even start looking.

You probably don't have to look much farther than any third-party modules you're
using in the installation.  I would spend a lot more time scrutinizing their
code than Apache's.

-- 
Keith Wannamaker
IBM HTTP Server Development 
RTP NC, USA

Re: Apache memory problems

Posted by Dirk-Willem van Gulik <di...@webweaving.org>.
I'd look at the OS first; one of the libraries might have a problem. You
can of course set the MaxRequestsPerChild sufficiently low to keep
it in check.

But if you really suspect apache (or one of the modules you compiled
in) secondly there is an option in alloc.c ALLOC_USE_MALLOC which
allows you to use a debugging malloc to examine where the problem
might be. 

DW.

On Fri, 28 May 1999, Graham Leggett wrote:

> Hi all,
> 
> A specific question about Apache and it's memory use.
> 
> My v1.3.7-dev installation's private memory usage slowly exands over
> time, eventually overwhelming the box. The interesting part about this
> is that the private memory footprint of *all* the httpd client processes
> is roughly the same and grows at the same rate, which means that all the
> httpd processes are leaking in the same way at the same time.
> 
> What part of the Apache code should I be looking in to fix this? Why
> should all the httpd clients expand by the same amount of memory at the
> same time? Can anyone offer any clues?
> 
> I am desperate for some kind of clue to the cause of this problem, I
> have no idea where to even start looking.
> 
> Can anyone help?
> 
> Regards,
> Graham
> 



Re: Apache memory problems

Posted by Dean Gaudet <dg...@arctic.org>.

On Fri, 28 May 1999, Graham Leggett wrote:

> My v1.3.7-dev installation's private memory usage slowly exands over
> time, eventually overwhelming the box. The interesting part about this

You can figure out if it's apache grabbing memory or a library by adding
-DALLOC_STATS to the build.  That will tell you just how much apache
actually allocated... I posted about it a few months ago, it requires a
bit of an understanding of how apache works with the processes and
everything to totally analyse the numbers.  But it'll get a bit more
info...

Dean