[clug] to swap or not to swap that is the question

Kim Holburn kim.holburn at anu.edu.au
Wed Jun 30 06:25:28 GMT 2004


On 2004 Jun 30, , at 9:54 AM, Martin Pool wrote:
> Suppose you start a program at bootup that allocates and writes to 4MB
> of memory, and then never touches it again.  In fact, suppose the
> process sleeps and never runs again at all.

Ummm, why run it then?

> With no swap space, that
> memory has to stay in RAM, using up space that could be used for disk
> cache, holding programs, or other data.  With swap, the kernel can
> write it to swap in the background, and never need to read it back in.
> So the cost is very small and it frees up memory.
>
> Obviously you don't have a program which does exactly that, but you
> probably do have some few pages like that.  So allocate a bit of swap
> and let the kernel do its thing.


-- 
Kim Holburn
IT Manager, Canberra Research Laboratory
National Information and Communication Technology Australia
Ph: +61 2 61258620 M: +61 417820641
Email: kim.holburn at anu.edu.au  - PGP Public Key on request
Aust. Spam Act: To stop receiving mail from me: reply and let me know.

Democracy imposed from without is the severest form of tyranny.
                           -- Lloyd Biggle, Jr. Analog, Apr 1961



More information about the linux mailing list