[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#485413: apache2: Apache crashes system due to exessive memory allocation



Hello Stefan!

Stefan Fritsch [Mon, Jun 09, 2008 at 09:59:10PM +0200]:
> On Monday 09 June 2008, Nico Schottelius wrote:
> > The question is how to debug that problem, find out which modules
> > allocates that much memory (most likely php, but where is the
> > evidence?) and why it allocates so much memory.
> 
> What is the value of memory_limit in your /etc/php5/apache2/php.ini ? 
> If it is large, maybe your php app simply uses that much memory.

[11:52] u0203:apache2# grep memory_limit /etc/php5/apache2/php.ini 
memory_limit = 128M      ; Maximum amount of memory a script may consume
(128MB)

On all four servers, all Debian standardconfigs.

> Php 5.2.6 fixes some memory leaks. You could try 5.2.6-1 from Debian 
> unstable.

Hmm, have to wait until it is in testing, as I don't want
to mix up testing/unstable. Is there a way to get notified,
as soon as it is available?

> Apache is known to leak memory in long requests (like when streaming 
> multimedia data) if the flush() function is used excessively. Do you 
> use implicit_flush in your php.ini? Does your application use 
> ob_implicit_flush() or many flush()s?

[12:08] u0140:~% grep implicit_flush /etc/php5/apache2/php.ini 
implicit_flush = Off

> If nothing helps, you can set MaxMemFree and/or MaxRequestsPerChild in 
> your apache config as a workaround.

I am trying the following hacks currently:
   - MaxRequestsPerChild on server u0203
   - Disabled SSL on server u0141

I did not know about MaxMemFree before your Mail, maybe I'll try
it on the third webserver.

My next step would be to compile apache2.2.8 and php 5.2.6 from
source with debugging symbols and run valgrind in front of it...
hope I don't have to do it, because this implies installing
full developement kit including mysql, postgresql, etc. dev
pakets...

Sincerly

Nico

-- 
Think about Free and Open Source Software (FOSS).
http://nico.schottelius.org/documentations/foss/the-term-foss/

PGP: BFE4 C736 ABE5 406F 8F42  F7CF B8BE F92A 9885 188C

Attachment: signature.asc
Description: Digital signature


Reply to: