how to debug memory leak/grow

Maxim Dounin mdounin at mdounin.ru
Mon Apr 22 17:27:37 UTC 2013


Hello!

On Mon, Apr 22, 2013 at 04:38:25AM -0400, gadh wrote:

> in my nginx, compiled with my modules, i see that under every day usage (its
> on a web site , i cannot reproduce this in my lab) the memory usage of nginx
> grows all the time, it has many open connections (but the total number of
> connections is high but stays roughly the same over time) and aftert a week
> or so it consumes about 7GB of ram so i have to reload its processes (8
> cores  = 8 nginx workers).
> 
> can somebody help me on how to debug this ? which tools you use ? valgrind
> did not help, even after applying the patches to nginx core for debugging
> with it.

Some tips about tracing socket leaks can by found here:

http://wiki.nginx.org/Debugging

Memory leaks by itself generally don't happen in nginx as it uses 
memory pools bound to requests for most of the allocations.

-- 
Maxim Dounin
http://nginx.org/en/donation.html



More information about the nginx mailing list