You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by Graham Dumpleton <gr...@dscpl.com.au> on 2006/07/31 08:09:04 UTC

Need confirmation of memory leak using Apache 2.2.2.

I am using Apache 2.2.2 and when using mod_python in a certain way, I am seeing
significant ongoing increases in memory use by Apache child processes.
Initially I thought I had stuffed up recent changes in mod_python 3.3 out of
subversion trunk that I had been making, but I went back to mod_python 3.2.10
and am seeing the same problem.

Can some one please run the following test and use "top" or some other means of
monitoring memory use to see if you can duplicate the problem. The test is really
quite simple actually.

# .htaccess

PythonFixupHandler handlers
AddHandler mod_python .py
PythonHandler handlers

# handlers.py

from mod_python import apache

def handler(req):
  req.content_type = 'text/plain'
  req.write('handler')
  return apache.OK

def fixuphandler(req):
  return apache.OK

The command I have been using to test is:

  ab -c 1 -n 5000 http://localhost:8082/~grahamd/MODPYTHON-155/hello.py

What is strange is that if I have only the fixup handler or response handler
invoked and not both, then memory leak isn't present. It is only when both are
being invoked that it leaks memory.

This occurs for me on Mac OS X 10.4, Python 2.3.5 and Apache 2.2.2, with
either mod_python 3.2.10 or mod_python 3.3. I haven't yet tested with older
Apache 2.0.58 as yet as don't have it on my box at present, but will download
it and see if that makes a difference.

I guess what I am trying to working out is if this is an issue with Apache 2.2.2
or whether it is mod_python and problem has been there for a while. Thus if
people with both Apache 2.0.X and Apache 2.2.X could test it it would be great.

Any help appreciated.

Thanks.

Graham