httpd not releasing memory after requests
httpd not releasing memory after requests
am 15.09.2007 16:52:05 von galmond
Hi,
It looks like the issue of memory leaks have come up in the past, but
I have a problem that seems specific to one WinXP machine running
apache 2.2.4 and php 5.2.4(another machine with a similar
configuration does behave this way).
Every request of even a simple html page results in the addition of
about 110k of memory usage to the httpd child process. When
php5_module is loaded, this number is about 520k. The memory usage
stays the same if a subsequent request occurs before the
KeepAliveTimeout period. Over time the process eventually runs out of
memory.
I assume that this is an OS dependency but I'm not sure what
strategies or tools to use for troubleshooting process behaviour. Any
suggestions?
Re: httpd not releasing memory after requests
am 15.09.2007 18:51:34 von galmond
Just an update...
I've installed Process Explorer and Process Monitor from
http://www.microsoft.com/technet/sysinternals which I've been able to
use to look at the httpd child process in more detail but I don't
recognize any clues. I also installed WinDbg but it's a little beyond
me and I'm not even sure if I'm on the right track by looking at the
httpd process (rather than some other OS thing that manages memory
allocation).
Re: httpd not releasing memory after requests
am 17.09.2007 16:49:03 von shimmyshack
galmond wrote:
> Just an update...
> I've installed Process Explorer and Process Monitor from
> http://www.microsoft.com/technet/sysinternals which I've been able to
> use to look at the httpd child process in more detail but I don't
> recognize any clues. I also installed WinDbg but it's a little beyond
> me and I'm not even sure if I'm on the right track by looking at the
> httpd process (rather than some other OS thing that manages memory
> allocation).
Have you followed the standard windows directive advice on the apache
website for 2.2.x:
ThreadsPerChild 250
MaxRequestsPerChild 0
Win32DisableAcceptEx
for instance. Win32DisableAcceptEx and a couple of others could be
tried.
I have had mixed results, but can report your setup plays nice with
windows for a couple of months uptime at least.
Re: httpd not releasing memory after requests
am 18.09.2007 01:06:11 von galmond
Yes, I've experimented with those various settings. If I set the
MaxRequestsPerChild to something relatively low (100) then I can force
the httpd child process to reset before it runs out of memory,
although this really just works around the memory leak problem.
I discovered that the memory leak is more or less eliminated if I
don't load the module_cgi.so module. Now the httpd memory usage only
creeps up about 4k for every request (rather than 520k). If I
experimented I could probably find the other modules that account for
this 4k. Why would module_cgi.so be related to this problem, even if I
don't serve any cgi requests?
Thanks