You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Marco Spinetti <m....@pisa.iol.it> on 2008/02/12 11:59:46 UTC

Memory leak?

I'm experimenting some memory leak in my apache 2.2 module.
I suppose that it's a memory leak because if I start apache (prefork) 
and I see with the top command (linux), the memory size (SIZE column of 
top) of httpd apache childs grows slowly with the increasing  of the 
requests.
For debugging I start apache in this way:

./httpd -X -k start &
gdb httpd [pid_previuos_command]

Then I make a request from onether shell: the problem is that I don't 
know how to discover the memory leak.
Could someone help me how to find the possibile memory leak?
Best regards

Marco



Re: Memory leak?

Posted by Jarek Kucypera <ja...@netstellar.com>.
 > Could someone help me how to find the possibile memory leak?

Divide and conquer: try to disable particular parts of your code and 
watch, when it stops eating memory.
For every alloacation find matching deallocation and check if there is 
possibility the resources are not released.
AFAIR APR memory pools,when compiled appropriately, has some support for 
allocation debuging,
see docs and source.
Use the force, when everything else fails ;)

J.K.