Linked by David Adams on Thu 20th Nov 2008 04:19 UTC
General Unix Linux and other Unix-like operating systems use the term "swap" to describe both the act of moving memory pages between RAM and disk. It is common to use a whole partition of a hard disk for swapping. However, with the 2.6 Linux kernel, swap files are just as fast as swap partitions. Now, many admins (both Windows and Linux/UNIX) follow an old rule of thumb that your swap partition should be twice the size of your main system RAM. Let us say I’ve 32GB RAM, should I set swap space to 64 GB? Is 64 GB of swap space really required? How big should your Linux / UNIX swap space be?
Thread beginning with comment 337960
To read all comments associated with this story, please click here.
my theory
by pixel8r on Fri 21st Nov 2008 03:16 UTC
pixel8r
Member since:
2007-08-11

my theory on swap is quite simple.

Allocate enough space for swap so that your system wont crash, should you ever feel the need to run lots of memory hungry apps all at once.

But when I'm using the computer, I treat swap as evil. If its swapping, it means I dont have enough RAM, and the solution is to increase my RAM.
I've been running with 512MB for a long long time and with very minimal swap usage (yeah I use linux, how'd you guess?). Lately my development needs have dictated that I increase RAM up to 1GB, but this is still below the current average.

It still frustrates the hell out of me when I need to use windows that windows insists on using swap well before my RAM is full. Why do I need a disk cache when the app I'm running is so painfully slow because its getting swapped out of memory?! Its moronic. There is never a good argument for swap IMO. If something's swapping, you need more RAM.

Reply Score: 1

RE: my theory
by bnolsen on Mon 24th Nov 2008 04:43 in reply to "my theory"
bnolsen Member since:
2006-01-06

On my 8 core dev system I turned off swap entirely. Problem was when I would make a screw up which caused a memory overrun I ended up having to either hard reboot the machine or else wait 20+ mins for the application (along with a bunch of other apps) to get OOM killt. Without swap this OOM cycle runs faster. I'm sure the better way is to probably set some sort of hard per process real ram limit.

Reply Parent Score: 2