made swap too small

Matt Graham mhgraham at crow202.org
Tue Jul 15 15:59:17 MST 2014


On 2014-07-15 15:36, Kevin Fries wrote:
>> the vanilla kernel's suspend-to-disk feature.  If you're using that,
>> then your swap partition size should be roughly equal to your RAM
> There are two types of swap in Linux.  The one everyone knows is the
> swap partition.  But you can also have a file based swap.

Of course.  Swap files can be useful, but they are slightly slower than 
partitions, and you can't use a swap file with the kernel's 
suspend-to-disk feature.

> And while you are limited to one partition based swap, you can have
> many file based swaps.

Huh?  Before 2.4.10, the kernel could use a maximum of 8 swap 
partitions/files.  ISTR the docs for SuSE 6.1 talking about multiple 
swap partitions in 1999.  "man 2 swapon" says the limit is at least 32 
now.  I've used 2 swap partitions not that long ago with a vanilla 3.12 
kernel.

> swap is a poor substitute for ram

Yes.  However, the swapper is supposed to find pages in RAM that aren't 
being used and push those pages out to disk, leaving more RAM for use by 
active processes (firefox, mysqld, gimp, libreoffice....) so the active 
processes run faster.  That's the theory, at least.  Since everyone and 
their brother now has at least 4G of RAM in their machines, swapping is 
less important than it used to be and a lot of the time, you can get by 
without it.

-- 
Crow202 Blog: http://crow202.org/wordpress
There is no Darkness in Eternity
But only Light too dim for us to see.


More information about the PLUG-discuss mailing list