> This revelation of how Perl does not free up memory it allocates is 
> worrying, especially as I do process large documents regularly.
> 
> If I read you right, you are saying that $r->child_terminate will force 
> the current thread to terminate, causing Apache to create a new thread. 
> Is that right? I use 'threads' in place of 'processes' as I refer to the 
> Windows implementation of Apache.

No, this only works with processes, not with threaded MPMs:
http://perl.apache.org/docs/2.0/api/Apache2/RequestUtil.html#C_child_terminate_

But that makes sense to me, if I have understood it correctly.

Once a perl process has allocated memory, it doesn't return it to the
system until the perl interpreter exits. It is, however, available to
the process for reuse.

So in a threaded MPM, a single process may grow in size, but all the
threads will have access to the allocated memory.

In (eg) the worker MPM, each process contains its own perl interpreter,
so if each process handles one image once in its lifetime, there is a
lot of memory that has been grabbed by perl which is not available to
create more perl processes.

... is what makes sense to me but may be utterly meaningless.

clint

Reply via email to