Change swap memory size after adding RAM?

8,008

Solution 1

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.

Solution 2

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.

Share:
8,008

Related videos on Youtube

Jawn
Author by

Jawn

Updated on September 17, 2022

Comments

  • Jawn
    Jawn over 1 year

    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?

  • Oli
    Oli over 13 years
    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).
  • user4124
    user4124 almost 13 years
    @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.