Memory usage doubles on reload

Maxim Dounin mdounin at
Fri Mar 7 10:27:05 UTC 2014


On Thu, Mar 06, 2014 at 03:01:49PM -0500, PetrHolik wrote:

> Hello Maxim, thanks for reply.
> Is there possibility to purge allocated buffer(RAM) in old(gracefully)
> worker processes? IMO worker thread have allocated all memory till last
> clients disconnects. That is really isue for us - we have currently 32Gigs
> of spare RAM to be able to handle reload under load.

All allocations done for a particular requests are freed as long 
as the request is finished.  The problem though is that OS 
memory allocators rarely return freed memory back to the OS, 
especially on Linux.  You may try playing with allocators and/or 
allocator options to make things better.

Note well that "spare" memory isn't really spare, as it can be 
used by OS for file cache.

Maxim Dounin

More information about the nginx mailing list