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

Sam Couter sam at couter.dropbear.id.au
Tue Jun 29 12:24:25 GMT 2004


Kim Holburn <kim.holburn at anu.edu.au> 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.

I think these opinions may be outdated, and come from the days when a
machine with 64Mb RAM was considered a supercomputer.

Running out of memory (including swap) is BAD BAD BAD. It causes much
non-deterministic behaviour for many reasons. Lots of programs and
libraries don't deal with malloc() failing, so programs crash. Linux
will overcommit memory by default, so even if malloc() succeeds, when
you try to address the memory it may not physically exist. Linux also
has an OOM killer which will pick the largest running program and
unceremoniously kill it. So Bad Shit (tm) will happen.

Having said all that, I believe running out of virtual memory is the
same thing whether that memory is all chip (RAM) or whether some of it
is hard drive. This may not have always been the case, however.
-- 
Sam "Eddie" Couter  |  mailto:sam at couter.dropbear.id.au
Debian Developer    |  mailto:eddie at debian.org
                    |  jabber:sam at teknohaus.dyndns.org
OpenPGP fingerprint:  A46B 9BB5 3148 7BEA 1F05  5BD5 8530 03AE DE89 C75C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/linux/attachments/20040629/6cb84894/attachment.bin


More information about the linux mailing list