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?

2 Answers 2


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.

  • 1
    I thought "rule of thumb" was 1.5x the amount of physical ram, not twice as much. And I have 6GB of RAM and things still end up in swap (usually cached items, I would assume).
    – Oli
    Jan 28, 2011 at 12:48
  • @Oli: 6GB of RAM and you get stuff on the swap partition? That's strange. Post the 'free' output to make sure. Ideally the swap should not be used at all in your case, and in the worst case you can force not to use the swap.
    – user4124
    Jul 6, 2011 at 7:27

Only if you think you are going to need it. If you are going to hibernate the machine, you need the swap at least as big as your ram.

More Info can be found at this Ubuntu FAQ on Swap Space . It also talks about how to change/add space.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .