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 337968
To view parent comment, click here.
To read all comments associated with this story, please click here.
UltraZelda64
Member since:
2006-12-05

Mac OS and Windows use swap files, which are transparent to the user and the programs. Just let the OS care about the size of the swap file and let me worry about my job. The OS can just start with the size of the RAM or half of it and increase the file size when neccessarry.

Windows does that, and it's really good at pissing me off. Not much is more annoying than doing something slightly unusual in terms of memory use, then the OS thinks, "oh, it looks like you might need more swap" and causes the hard drive to grind away for a while, producing fragments in the swap file in the process.

Would it be so hard for the OS to just ASK? There's a chance that maybe, just maybe, I didn't *want* my swap space to be increased for [insert-stupid-action-here]. Maybe it wouldn't be so bad if Windows wasn't so stupid when determining the default minimum size for swap file, but as it is it's a major annoyance and was always the first thing I changed when reinstalling the OS.

In Windows, I just set the both the minimum/maximum size to 768MB or so so it didn't resize, and it worked fine.

In Linux, I make a 512MB or 768MB swap partition (depending on distribution and whether repartitioning is feasible or not), and if I absolutely *need* more I create and/or activate a 256-512MB swap file. I also make sure my swap partition is on a drive with my /home partition, separate from my system drive, but often create the swap file in / (which is, of course on the system drive).

This all on a machine with only 256 megs of RAM.

Reply Parent Score: 2