5

My question is what is swap? I am planning to install Ubuntu 12.10 version. I have 2.5 gigabytes of ram and want to use it all. How do I do the right way. I plan to use 500 gigabytes and a Sempron core processor. Do I need the swap?

2

2 Answers 2

4

SWAP can best be described as "virtual memory" I am not an expert on explaining this, but what it does is create a small partition that your system sees as RAM. It then uses this space BEFORE accessing ram when you are running applications, thus allowing your computer to be faster because applications use less actual RAM.

The recommendations I have seen the most (& that I follow) is create a Swap of approximately half your physical ram (if you have 2GB RAM, create 1GB swap) Keep in mind however, if you install Ubuntu 12.10, you don't really have to worry about this since the installer can do it all for you. Unless you want to do it yourself of course!

6
  • 5
    Actually, RAM is way faster than Swap because Swap is stored on your hard drive. Swap is mainly used for hibernation where the computer moves everything from the RAM into the Swap and shuts down.
    – Seth
    Jan 25, 2013 at 16:23
  • I stand corrected! As I said, not really an expert on this! Jan 25, 2013 at 16:25
  • It's OK. The rest of your answer is good. +1
    – Seth
    Jan 25, 2013 at 16:28
  • 1
    Swap is not "used before accessing ram" and it does not make things faster, it makes them slower. Swap is used when you are low on ram, and it is several orders of magnitude slower than ram, so using it bogs down the system.
    – psusi
    Jan 25, 2013 at 16:55
  • 1
    Another thing to keep in mind is: swap and virtual memory are not the same thing. Virtual memory includes both swap and RAM, and is a memory model. Swap is memory stored on disk that can be moved back to RAM. RAM is the primary (but not the only) kind of physical, volatile memory in a computer (see the primary storage section of this Wikipedia article). Virtual memory is sometimes used to mean swap but that's incorrect. Feb 10, 2013 at 16:42
3

The correct way to think of SWAP memory is to think of it as RAM that exists on your hard drive. When your actual RAM gets full, memory that you don't need right now gets copied to the swap ram on your hard drive. When that memory is needed it is swapped (get it? swapped?) into main ram and that ram is copied into the swap ram. This allows the operating system to function as having more available ram than it actually has but incurs quite a severe performance penalty. It is always a good idea to have more ram :)

With 2GB of RAM it is preferred to provide 2GB of swap disk ram.

1
  • Hmm,,, guess I got schooled! LOL! My apologies for my misunderstanding of the topic! Jan 26, 2013 at 5:36

You must log in to answer this question.

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