Friday, February 27, 2009

Desktop Linux Dilemma - To Swap or Not To Swap?

Linux swap space has been a mystery for years. The same is true for Windows. Remember those Virtual Memory and pagefile thing?

In old days when RAM was really costly, Linux community, suggested to have swap space two times that of physical memory (RAM). Time went by, RAM has become cheaper and larger, and now they say you should still have a swap space 1.5 times the size of physical memory, bla... bla... bla...

Let me tell you, I neither use/create swap partition in my Linux (Mepis 8.0 and PClinuxOS 2009 TR3), nor do I create/use pagefile in my Windows XP Pro SP3 machine at office.

In all I have just 1GB of RAM in home laptop and office workstation, both. I have been running of them for 1 year now, and I never run into any problems whatsoever. Interested what do I do on both the machines? I surf the web, do some word-processing, listen to music, watch movies, and occassionally do some video/audio editing.

So, what's the use of swap, unless I use hibernation or remaster Linux to create custom disks? I never needed it though I have only 1GB of RAM, whereas these days notebooks and desktops are being shipped with more than 1GB RAM such as 2GB, 3GB, 4GB, and even 8GB. Does swap space make sense in such a scenario?

I welcome your comments and appreciate all your ideas.

3 comments:

Anonymous said...

To deconstruct the Swap Myth I would suggest you to keep you 1GB swap partition, if you have 512MB of physical RAM or above.

The rule of keeping a swap partition 1.5 or 2 times that of physical memory holds true only if you have less than 512MB of RAM.

Of course, as a home user, you can do away with swap if you have more than 1GB of RAM but to play safe it is better to keep a swap partition. Because hard drive have become cheaper and bigger, and 1GB swap partition does not takes that much of drive space.

manmath sahu said...

Lin_admin,

thanks for your suggestion. linux as a home desktop is happy with 1gb of RAM without any swap. and if you have more RAM, it's merrier.

Hubert said...

I use PCLOS2009 on a notebook with 1GB of memory.
I also use often VirtualBox to study some other operating systems like fi Windows7.
Without the virtual environment there is no Swap being used. But when running a guest in VirtualBox the swap is being used. This is because half the memory (512MB) is assigned to the guest.

How about this