mod_perl leaks memory on FreeBSD

ilance len at ilance.nl
Fri Jan 6 02:03:47 PST 2006


Apache / mod_perl leaks memory every time it receives a SIGHUP (apachectl 
restart).
This is the case on all of our FreeBSD boxes (5.3, 5.4 and 6.0).

I've tried to reproduce it on other platforms. It does not happen on Linux 
or Mac OS.

No need to do anything special to reproduce this on FreeBSD though.
Just install the mod_perl2 (or mod_perl for apache 1.3) package and issue 
some "apachectl restart" commands.
You'll see the apache parent process grow with about 20 - 50 %

--------------------------------------------------------------------
apachectl start
# ps aux|grep httpd | grep root
root  70820 59.0  5.6 46408 43552  ??  Ss    4:03PM   0:04.40 
/usr/local/sbin/httpd -k start

So: 43MB right after starting (that's quite large because I'm preloading a 
lot of stuff).

Now send it a SIGHUP:

# kill -HUP 70820
# ps aux| grep httpd | grep root
root  70820 17.4  7.7 62440 59564  ??  Rs    4:03PM   0:08.48 
/usr/local/sbin/httpd -k start

Wow: the HTTP root process has grown from 43 to 59MB just because I sent it 
a SIGHUP.

On my test box it takes about 50 "apachectl restart" commands, but then 
apache crashes with a "Out of memory during request" error.
I was using a log rotation script which send a SIGHUP to apache every night. 
That made my apache/mod_perl boxes crash every few weeks.

Len Kranendonk 



More information about the freebsd-apache mailing list