httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ras...@mail1.bellglobal.com
Subject Re: alloc.c etc.
Date Tue, 14 Jan 1997 14:54:05 GMT
> > There is no need for any calls to free() in the Apache pool-based memory
> > allocation scheme.  malloc'ed memory cannot be returned to the system
> > until after the process exits anyway.  All free() does is indicate that
> > the memory block free'ed is available for re-use by the same process. 
> > If you 
> 
> I don't think that's a particularly valid assumption since FreeBSD's
> malloc does return memory to the system when it's freed.

That may be.  I am not familiar with FreeBSD.  Traditional Unix platforms
are not able to give data space back to the system for use by other processes.
If FreeBSD can indeed shrink the data space of a process as it is running,
then the whole palloc scheme should probably be re-thought on that platform.
Memory-wise there is a lot of potential savings to be had.  Especially when
it comes to some of the larger modules.  Both mod_perl and mod_php will
allocate memory based on the memory requirements of the scripts they are
processing.  If you have a very memory hungry script that only runs once in
a while, the data space of the httpd that is unlucky enough to get the 
request will balloon, and it will stay that large until it is re-spawned.
It would be very nice to be able to return that memory to the system and
reduce the footprint of such a process after it has finished parsing the
memory hungry script.

-Rasmus

Mime
View raw message