I had earlier always installed Linux distros on my desktop and never bothered about swap size. However, laptops being little sensitive (compared to desktop) I am taking extra caution and seeking expertâs advice even on these lil things.
On a Core2Duo 2.2GHz Laptop, how much should be the optimal swap partition size?
Is the old rule of thumb: swap=(2XRAM) still valid?
Iâve 2GB RAM as of now and Iâll probably upgrade it to 4GB next year. So with multiple distros (Vista+few Linux) what should be the optimal swap size for my laptop.
P.S: I searched the forums but couldnât find the ans.
And if you had, you would probably have found conflicting answers. You need some swap but, as people have pointed out in other posts, the more RAM you have the less likely Linux is to use swap and, unless you are using memory very intensively, you may find that with 4Gb, it never uses whatever swap you have set aside.
I have 1Gb RAM and 2Gb swap installed by openSUSE and at the moment I am using no swap and less than ½Gb (plus ŸGb caches).
Apart from the conflicting answers, I also read:
To have âsuspend to diskâ option that is similar to Hibernate, I need to have swap=(2xRAM).
This caused the perplexed situation.
YMMV, but on all of my systems I have at least 2GB of RAM. I did some mild experimentation in the past, and found that with that amount of RAM, my system never used swap unless the system crashed (which only happened once b/c I was an idiot ).
So, if your system has 2+ GB of ram, I would allocate 1GB of swap space and let it be.
Slightly off topic, but if youâre coming from Windows land, and are expecting recommendations similar to the mountain of FUD that exists in regards to the Windows page file, you wonât find any. The linux swap partition is simpler than the Windows page file, and so the recommendations are more straight-forward.
2xRAM is the Windows thinking, linuxâs kernel is very good at managing the memory and you certainly donât need twice as much swap as you got RAM. Having 2GB of memory i wouldnât even personally create swap. At most youâd need the same amount of swap as RAM.