Hi Ben, How are you detecting that a process is growing by a couple megs? Are you looking at the VSS (virtual segment size) because if you are, on most un*x-es this figure should remain roughly the same despite shared segments.
Also, you mention that the processes grow by a couple megs. By this do
you mean that each subsequent fork is a few megs larger than the
parents?
One more question, what mpm are you using? If you are using a threaded
mpm, the perl interpreters are cloned and all variables are cloned
between interpreters, that is unless you explicitly share them. I don't
know what effect this behavior has on copy-on-write pages (aka shared),
but I wouldn't be surprised if this defeats this type of sharing.
Richard F. Rebel
On Thu, 2005-02-10 at 16:27 -0600, ben syverson wrote:
> I don't think I'm getting mod_perl's shared memory scheme yet. I have a
> package that gets loaded in my startup.pl, and it basically does this:
>
> use vars qw(%words);
> open FILE ...
> while <FILE> {
> $words{$_} = 1;
> }
> close FILE;
>
> ...creating a hash of words from a CR-delimited list of words. The hash
> winds up taking up a few megabytes of RAM, but it's absolutely never
> written to, so I figured it would be shared between the mod_perl
> processes. However, each process grows by a few megs...
>
> What's the best way to get around this?
>
> - ben
>
--
Richard F. Rebel
cat /dev/null > `tty`
signature.asc
Description: This is a digitally signed message part
