Ubuntu – Do I need a swap partition?

partitioningramswap

I have 4GB of RAM and I want to install Ubuntu. Do I need a to have a swap partition? Because my computer has 4GB RAM, I do not think it is necessary to have a swap partition. If I do need to have a swap partition, should it be a 4GB or an 8GB partition?

Best Answer

Whether you need swap space or not depends on the number and type of applications that you run. I have a desktop system with 6 GB of RAM and no swap configured. 99.9% of the time that works fine for me. Performance is good and I can run many concurrent applications. However I can recall at least two times when my system slowed to the point where it became totally unresponsive due to excessive memory use. In one of those cases I was able to bring up a console window and kill one of the big memory using tasks. In another case I could not even do that and my only choice was to pull the plug on the system, losing everything that was in progress.

We don't know whether your usage patterns are like mine however, if I were doing it again, I would have configured some swap space.

In my case, 8 GB total would have been adequate. Unless you are greatly strapped for disk space, I therefore recommend that you dedicate 4 GB for swap. 8 GB won't hurt you but is less important if you can use the disk space for more important things.

Related Question