Setting MaxRequestsPerChild to a non-zero limit
solves some memory-leakage problems caused by sloppy programming
practices and bugs, whereby a child process consumes a little more
memory after each request. In such cases, and where the directive is
left unbounded, after a certain number of requests the children will
use up all the available memory and the server will die from memory
starvation. Note that sometimes standard system libraries leak memory
too, especially on operating systems with bad memory management.
If this is your situation you may want to set
MaxRequestsPerChild to a small number. This will
allow the system to reclaim the memory that a greedy child process
has consumed when it exits after
MaxRequestsPerChild requests.
But beware—if you set this number too low, you will lose some
of the speed bonus you get from mod_perl. Consider using
Apache::PerlRun if the leakage is in the CGI
script that you run. This handler flushes all the memory used by the
script after each request. It does, however, reduce performance,
since the script's code will be loaded and
recompiled for each request, so you may want to compare the loss in
performance caused by Apache::PerlRun with the
loss caused by memory leaks and accept the lesser of the evils.