Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • by Juerd (1796) on 2005.12.18 18:31 (#45253) Homepage
    Although when *forking*, you're typically sharing all the memory that isn't touched by the child processes.

    So if you run mod_perl the old fashioned (and IMO still: better) way, consider loading all of POSIX upfront. This will improve runtime of the first script (per Apache child!) that needs something out of POSIX, and memory use, as you now load everything only once instead of parts duplicately.

    As always: the way you use code is important for the way you should write it. A good rule of thumb is to always explicitly import (never use the default imports), and if you can benefit from loading everything in the child process, do it explicitly there.

    My Apache processes on one machine are 15 MB each of which 11 MB is shared. This used to be 15 MB of which only 3 MB was shared. With a few dozen Apache processes, this saves me a whole lot of memory!