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

Martijn van Oosterhout kleptog at svana.org
Tue Jun 29 12:18:29 GMT 2004


On Tue, Jun 29, 2004 at 10:00:29PM +1000, Kim Holburn wrote:
> I have read several places that linux systems are always better with 
> (HD) swap (suggestions were that swap allows the system to not run out 
> of memory).  I don't understand this.
> 
> Suppose you have a system with say 1G of RAM and swap of 2G.  How is 
> that better than say a system with 2G of RAM (or even 3G RAM).
> 
> Is it because HD is so much slower that the wait causes everything to 
> slow down?

Swap basically allows the system to free up unused pages in memory.
No-one is suggesting 1GB RAM/2GB swap is better than 2GB RAM. They just
suggest that it's better than 1GB RAM/no swap.

Besides, if you don't have swap, the system will force out mmap()ed
pages instead. Every mmap()ed program is just like adding a little bit
of swap, they can be tossed out and reloaded when needed...
-- 
Martijn van Oosterhout   <kleptog at svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux/attachments/20040629/a92bd0cd/attachment.bin


More information about the linux mailing list