While installing Ubuntu, It asked me to allocate something called Swap Space, What exactly is it? What would happen if i dont allocate it?/ What is the use if i did allocate?


Swap space is space on the disk used as if it was temporary memory (RAM). If you did allocate it, your computer would use it when its RAM is starting to be used up. If you don't allocate it, nothing happens unless you run out of RAM space. Then any program wanting more RAM would be closed.

If you want to use hibernate, you need at least as much swap as you have RAM. This is because when your computer hibernates, it copies the RAM to the swap and turns off.

As binW says, swap is slower than RAM.

  • Then, if i make Swap Space very large, say 20 gigs, will my computer become super fast? but very quickly etc? Nov 29 '11 at 8:22
  • 3
    Swap is allways slower than actual hardware RAM. You should understand that swap space is used as RAM but it is not actually RAM. This means that if you have an app which requires 3GB ram and you only have 2GB RAM in your system, your system will use swap space to extend your RAM so that you can run that application. But it will be slower than using actual hardware RAM because your system will need to bring things from swap into RAM before using them and move things back to swap which are not being used at the moment.
    – binW
    Nov 29 '11 at 8:55

It is a virtual memory space which is used for hibernation, intensive memory processes and general memory consuming applications. To see details of your swap partition just run at the terminal:

cat /proc/swaps 

Swap is used by the kernel of your system whenever it really needs it. Swappiness is a term which refers to the tendency of the kernel to move processes out of physical memory (hardware RAM) to the swap disk. To change the default tendency of your system run at the terminal:

gksudo gedit /etc/sysctl.conf

and change the variable:


from www.linux-review.com/linux/general/all-about-linux-swap-space



If you hibernate then as far as I know you'll need swap to do so.


in addition to answers already submitted, please note that access to HDD where swap is really in, is much slower than access to data in real RAM. Access to hdd is measured by millisecond whereas access to RAM is measured in microsecond.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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