perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Gormley <>
Subject Re: No image creation in mod_perl (was RE: Apache2/MP2 Segfaults ...)
Date Tue, 28 Mar 2006 08:10:17 GMT
> 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:

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.


View raw message