Friday 8 February 2019

linux - Why should the size of the swap partition be double of the RAM size?


Why is it recommended that the swap partition size be double that of the RAM size?


Specifically, why would I need to store data stored in the RAM twice??



Answer



Swap partition having double the memory size is just a general guideline, not a hard and fast rule. You'll need minimum 1 X your memory size if you suspend-to-disk (hibernation), and add enough spare for usage of 'swapped' memory which goes beyond your physical one. Hence the recommended 1.5 to 2 times.


I would think it also depends on the nature of your application usage and size of your physical memory etc. If you have anything beyond 2GB RAM and using non-memory intensive applications most of the time, you might not need swap partition at all, not big one anyway.


Having a big swap file and slow harddisk can be really punishing for your system too.


Here are a few useful reads:


Ubuntu SwapFAQ
SUperuser - Swap partition size for 4GB RAM
Do I Need a Swap Partition and If So, How Big?


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...