Booker C. Bense
3/17/2006 9:29:00 PM
-----BEGIN PGP SIGNED MESSAGE-----
In article <7d20c3f1c9ff08ff73faab5feefc8eb2@ruby-forum.com>,
Toby DiPasquale <toby@cbcg.net> wrote:
>Hi all,
>
>I am in the middle of writing some code that will exist as a
>long-running process on a number of machines. I am having trouble
>keeping memory utilization down, which is important in this case,
>because other processes on these machines will have priority to use the
>majority of RAM on these boxes for other tasks. The daemon itself is
>pretty simple, just reading and writing files and keeping some small
>state, but it also needs to cache large writes from multiple clients.
>When it does this, I find that this memory is not freed.
>
_ This is generally true of all unix processes. They do not
return allocated memory back to the system until they exit.
Freeing memory inside the code merely allows you to use it
again, it does not make it available to the system.
_ If your process is not using the memory, it may stay swapped
out, ( look at the real and virtual sizes ). If this is really
an issue, the standard way around it is to do the memory
intensive part in a forked subprocess that exits after it's
done.
_ Booker C. Bense
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
iQCVAwUBRBsqMGTWTAjn5N/lAQHVbwP/XYqiyZsWzCqsYNfzP4rCe5cEzWbKBBfU
54A/x/DDnImzpM3MYcIG4Um2AAGFBYMrylxEeTv0Ot6RMi7Nl2NJLIzIg/6lGh1M
6d1ojbnddmUGfJXuYDZ2/lcWDWYzYCM6hYbWGh7h6eMYtNVZizE1k9ebA4zL+H0i
jFU8K8Aoe7k=
=ZbII
-----END PGP SIGNATURE-----