Re: [mp1 and mp2] Grokking memory
[prev]
[thread]
[next]
[Date index for 2005/02/10]
--=-vJiRqQBAmHKkMfH3d/hu
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
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=20
> package that gets loaded in my startup.pl, and it basically does this:
>=20
> use vars qw(%words);
> open FILE ...
> while <FILE> {
> $words{$_} =3D 1;
> }
> close FILE;
>=20
> ...creating a hash of words from a CR-delimited list of words. The hash=20
> winds up taking up a few megabytes of RAM, but it's absolutely never=20
> written to, so I figured it would be shared between the mod_perl=20
> processes. However, each process grows by a few megs...
>=20
> What's the best way to get around this?
>=20
> - ben
>=20
--=20
Richard F. Rebel
cat /dev/null > `tty`
--=-vJiRqQBAmHKkMfH3d/hu
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQBCC+Lkx1ZaISfnBu0RAjcZAJ9K6SGkqzNTE4Wx2IACjUz6Z2Vv/wCdH72o
jGkJWqf2Cvvm903Gg1c8q9I=
=xbjd
-----END PGP SIGNATURE-----
--=-vJiRqQBAmHKkMfH3d/hu--
 |
(message missing)
|