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?
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!
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.