Linux – swap partition

linuxpartitioningswap

I read that the swap partition must have the double size of your RAM, that is optional to install, that is for hibernation mode only, several technical information that tells me what to do. I am using linux (Ubuntu at the moment).

Could anyone explain better swap partition?

Like:

  • What is
  • What is for
  • When should I use
  • Why should I use
  • How to partition correctly
  • Pros/ Cons to add this to system

Best Answer

The main ideas before you dive into some guides if you feel like it to learn more details:

What is

It's a special type of partition (sometimes OSes simply use one giant swap file).

What is for

The swap partition is used by an OS to artificially increase the size of the memory.

When should I use

When you think that the size of your physical memory (a.k.a. RAM) won't to be enough to run all the programs you plan to use.

Why should I use

Because you don't want programs to crash because they are out of memory.

Pros/ Cons to add this to system

  • Pro: artificially increase the size of the memory, meaning that you could run more programs that you have done without it.
  • Con: disks much slower than RAM
Related Question