new memory = more swap?

Kent Borg kentborg at borg.org
Thu Mar 25 20:11:50 UTC 2004


On Thu, Mar 25, 2004 at 02:21:24PM -0500, duncan brown wrote:
> well, yes and no.  the old '2 x memory = swapsize' addage is sort of
> outdated.

My suggestion, if you have a reasonably modern machine and have enough
disk space, is to use 1 GB of swap.  Period.

Current Linux kernels, and current disk and bus speeds, just seem to
fit 1 GB.  With a little RAM it is possible to use a good chunk of
that without being unusably slow.  On machines with tons of RAM,
having a "little" swap--an amount that is well less than your
RAM--seems cheap and harmless insurance.  On in between machines I
have seen the kernel use swap even when there seemed no particular
reason.  It seems to like swap.

Having less than 1 GB doesn't save much, and having more is hard to
imagine using.

An exception: if you have a specific data set that is X-big, then
certainly make your swap plus RAM big enough to easily handle X-bytes
with some extra slop.  Also make sure your RAM holds your working set.

Another exception: if you have a lot of RAM and are afraid of
swap-based delays, experiment with using no swap.  You might get the
more predictable behavior of things either working or pretty much not
working, without a long, drawn out degradation path.  It is a simpler
case, and whether it is useful depends upon your needs; I doubt this
is a very common case.

Otherwise, for the moment, 1 GB seems pretty nice.


-kb, the Kent who wants his computer to degrade gradually instead of
suddenly refusing to do things, but that isn't for everybody in all
circumstances.





More information about the users mailing list