Ubuntu – Change swap memory size after adding RAM

10.10memoryramswap

I ordered some addon RAM a few days ago to install on my Ubuntu 10.10 stationary computer and while giving it some thought, I remember that I previously did change the SWAP memory file size on a XP computer after doing a RAM upgrade in the past.

Should I change the SWAP memory size (increase?) after installing more RAM into my computer?

Best Answer

The swap partition is used to

  1. move temporarily running programs that are not active,so that to make space for the programs being used.
  2. for hibernation, where your entire RAM is copied to the swap partition.

Therefore, if you will be using hibernation, you should have a swap at least as big as your RAM, and a bit more just in case.

A rule of thumb is to make a swap partition as big as twice your RAM but not go over 3GB (because you will be wasting space).

It is OK to create a second swap partition and have them both active. Linux uses them as if they were a continuous swap partition, so it is fine.

Typically, if you have over 3GB of RAM, then you will notice that Ubuntu will not have a use of your swap. Run the free command and notice the value for Swap: + used. In most cases it just stays to 0.

Related Question