How much swap?

Christopher Browne cbbrowne-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Wed Oct 25 16:44:32 UTC 2006


On 10/25/06, Giles Orr <gilesorr-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
> There's this old story that swap space should be equal to twice your
> RAM, and I've heard it for more than a decade of working with Unix.
> But I've never seen a satisfactory explanation (or any explanation at
> all) of why this should be so.  I have this bizarre idea that the more
> RAM you have the less swap you need, and that a person with 4Gb of RAM
> *doesn't* need 8Gb of swap.
>
> Obviously this will be dependent on application: a person who expects
> to be manipulating multi-layer 24"x36" images in the GIMP might
> consider 12Gb of virtual memory merely adequate, and servers will have
> other considerations.
>
> Can anyone explain the whole swap=2xRAM thing to me?  Thanks.

A long time ago on a BSD 4.2 or 4.3 system far far away (this would be
back in the 1990s), the VM system was designed in a way that did
indeed require that there be 2x as much swap space as real RAM.  This
was needful in order that it could be guaranteed that there was space
to swap out applications to disk if need be.  But that was a VERY long
time ago.

If memory serves, there were Linux releases in the 2.4 days where
there were some VM pathologies where things would break unless you had
[a fair amount of swap]; this was a pretty serious VM bug which has
since been repaired.

There is not now any meaningful rule by which it should be required
that swap = 2xRAM.
-- 
http://www3.sympatico.ca/cbbrowne/linux.html
Oddly enough, this is completely standard behaviour for shells. This
is a roundabout way of saying `don't use combined chains of `&&'s and
`||'s unless you think Gödel's theorem is for sissies'.
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list