apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brad Nicholes" <BNICHO...@novell.com>
Subject RE: APR pool maintains too much free list
Date Mon, 28 Jan 2002 17:10:56 GMT
This would be great for NetWare.  We have had to stick with malloc and
free because there wasn't a way of freeing up the memory pools short of
killing the process.  Since NetWare only supports threads and therefore
only runs a single instance of the server, killing the server just to
clean up memory is a bit of a problem.  If the memory pools had a way of
doing garbage collection so that we don't end up with a lot of unused
memory laying around, that would be great.

Brad

>>> "Sander Striker" <striker@apache.org> Monday, January 28, 2002
9:50:33 AM >>>
[...]
> >There is that, although I must admit that I have a 'hi free'
> >patch lying around.  The idea is to free() all mem on the freelist
> >when the freelist size goes over a certain threshold (like a few
> >MB).  I would need some feedback on this though,
> >
> 
> The high free threshold would be useful in at least one
> place that I can think of in Apache.  If we change the
> worker MPM so that each worker threads can own a persistent
> pool (and clear it, rather than destroying it, after each
> request), then it would be good to have a mechanism that
> sets the max size of a pool's free list following
> apr_pool_clear().  E.g., I'd want to configure each ptrans
> pool to keep three 8KB blocks in its allocator, for a total
> of 24KB, in order to avoid mallocs on the next request most
> of the time; but if the last request allocated 10MB within
> the pool, we should return most of that space to the system
> heap.
> 
> But IMHO the only time when we should apply the high free
> threshold is when destroying or clearing a pool.

And that is how it works.
 
> --Brian

Sander


Mime
View raw message