Re: why swap at all?
From: John Bradford (john_at_grabjohn.com)
Date: Wed, 26 May 2004 10:06:58 +0100 To: Anthony DiSante <firstname.lastname@example.org>, email@example.com
Quote from Anthony DiSante <firstname.lastname@example.org>:
> As a general question about ram/swap and relating to some of the issues in
> this thread:
> ~500 megs cached yet 2.6.5 goes into swap hell
> Consider this: I have a desktop system with 256MB ram, so I make a 256MB
> swap partition. So I have 512MB "memory" and if some process wants more,
> too bad, there is no more.
> Now I buy another 256MB of ram, so I have 512MB of real memory. Why not
> just disable my swap completely now? I won't have increased my memory's
> size at all, but won't I have increased its performance lots?
> Or, to make it more appealing, say I initially had 512MB ram and now I have
> 1GB. Wouldn't I much rather not use swap at all anymore, in this case, on
> my desktop?
In my experience, it's perfectly possible to run a typical desktop system with
no swap at all. Certainly the 'double the amount of physical RAM' guideline
has been taken far too literally in my opinion.
As you point out, if a typical system works fine with 512 Mb of storage, it
shouldn't matter what the mix of physical and virtual memory is. Of course,
it will make a difference to performance, and there is a minimum practical
amount of real RAM because some things are unswapable, but in my opinion it
is absolutely wrong to size swap partitions simply by looking at the amount of
physical RAM in a system and not considering the requirements of the workload.
Double the physical RAM is usually more than enough these days, and because
most of the time the negative effects of too little swap are more noticable
than too much swap, this 'rule' seems to work well enough.
See my recent posts in another thread about solving computing problems by
learning solutions to common scenarios and not learning about computers in a
generic way - in my opinion, the widespread inefficiency of swap space is a
classic example of how this simply doesn't work very well.
Instead of trying to work out how much swap space is needed for a particular
hardware configuation, I suggest that users look at the workload first.
Infact, it's generally sensible to think about the workload before buying any
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to email@example.com
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/