Do I need a swap partition? [duplicate]

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?


Solution 1:

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.

Solution 2:

Si. Una partición de swap de 4GB (8GB no es necesario) hará que su sistema sea mucho más estable y es muy recomendable. Cuando el sistema se queda sin memoria libre, se canjeará a la partición de intercambio, y si no hay una partición de intercambio, el sistema se arrastra a un alto. La función de hibernación también necesita de intercambio para trabajar.

--

A swap partition of 4GB (8GB is not required) will make your system much more stable and is highly recommended. When the system runs out of free memory, memory contents will be exchanged into the swap partition, and if there is no swap partition, the system crawls to a halt. Hibernation also needs swap to function.