Ubuntu – How big should I make the swap partition

installationpartitioningswap

I'm (re)installing Ubuntu on my Toshiba NB100 netbook (Intel Atom, 120GB HD, 2GB RAM). Already have a partition I call "Stuff" with all my media and docs. Will be deleting the one I had Win7 on (making it the swap), and then there is a recovery one.

How big a swap partition should I create?

Best Answer

See https://help.ubuntu.com/community/SwapFaq

Here is an excerpt:


How much swap do I need?

For less than 1GB of physical memory (RAM), it's highly recommended that the swap space should, as a base minimum, be equal to amount of RAM. Also, it's recommended that the swap space is maximum twice the amount of RAM depending upon the amount of hard disk space available for the system because of diminishing returns.

For more modern systems (>1GB), if you use hibernation, your swap space should minimum be equal to your physical memory (RAM) size, otherwise you need a minimum of round(sqrt(RAM)) and a maximum of twice the amount of RAM. The only downside to having more swap space than you will actually use is the disk space you will be reserving for it.

The "diminishing returns" means that if you need more swap space then twice your RAM size, you'd better add more RAM as Hard Disk Drive (HDD) access is about 10³ slower then RAM access, so something that would take 1 second, suddenly takes more than 15 minutes! And still more than a minute on a fast Solid State Drive (SSD).