Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

4 Answers

up vote 6 down vote accepted

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.

share|improve this answer
    
Then, if i make Swap Space very large, say 20 gigs, will my computer become super fast? but very quickly etc? –  kernel_panic Nov 29 '11 at 8:22
2  
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
add comment

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:

vm.swappiness=10

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

share|improve this answer
add comment

https://help.ubuntu.com/community/SwapFaq

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

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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