httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@ai.mit.edu (Robert S. Thau)
Subject Re: Memory Pool Management Question
Date Wed, 08 May 1996 17:24:37 GMT
Well, it's like this.  When a pool is cleared, the pool system puts the
blocks in which that pool's memory were stored onto a free list.  This
makes them available for further calls to palloc (involving allocation
from other pools).  It could, I suppose, call free() instead.  However,
that would not cause the memory to be returned to the system in any
meaningful fashion --- that is, the process's data segment would not 
shrink.  It would merely make it available to further calls to malloc()
in the same process --- most probably from a get_block() call inside
palloc().

The bottom line is that if you are chewing up a few megabytes on any
request, and those requests will run with any frequency at all, then
you will wind up with a pool of server processes with very large data
segments, which will likely run you out of RAM, buffer cache, and maybe
even swap space.

The solution, of course, is not to get into that situation --- either
by judicious creation and destruction of sub-pools (perhaps on the model
of what goes on in mod_dir.c), or by explicit invocation of malloc() and
avoidance of hard timeouts.

rst
Hope this helps...

Mime
View raw message