0

This question already has an answer here:

I want to migrate from windows to Ubuntu, so I decided that I want to install Ubuntu 16.04.

I have a hard drive with 5400 rpm and 16 GB RAM, how big should swap partition be?

I don't know the purpose of swap partition, but I've heard that is a need for hibernate and other stuff.

Thanks in advance for answers!

marked as duplicate by Charles Green, Panther, Zanna, karel, edwinksl Nov 9 '17 at 4:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

In simple terms, the swap partition or swap file is used when your installed memory is full and instead of the computer crashing it will place some of its memory in the swap partition.

The swap partition is also used during hibernation. All of the information in memory will be written to the swap partition so the computer does not 'forget' what it was doing when the computer goes into hibernation.

The general rule for swap partition size is equal to the amount of installed memory. In your case 16GB. There must be enough space to write everything in memory during hibernation.

If you do not use hibernation you can decrease (or increase) your swap size. Remember that when the computer uses swap instead of installed memory it will be much slower because reading from a disk take much longer that memory.

  • So, when I do put my laptop to hibernate and then reopen it, It will run all the programs from swap partition? Seems kind of strange, and as you said, slow. – yierstem Nov 8 '17 at 14:18
  • Not exactly, When you close the lid it will write all memory to swap and power down the cpu and memory. When you open it it will read swap and write it all back into memory then use it. – jc__ Nov 8 '17 at 14:32
  • When you run a few large memory intensive programs and the computer uses all of your memory it will then start to use the swap space as addition memory. Thats when it gets slow. – jc__ Nov 8 '17 at 14:32
  • Thanks! I understand now, I had few problems with hibernation on an old PC in the past (it just got stuck and nothing happened), that's why I was asking. – yierstem Nov 8 '17 at 15:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.