What should my swap size be if I have 32GB of RAM?

If you want hibernation to work, it has to save everything in RAM to swap space so that it can be restored when the computer is turned on again, so you'd need at least 32 GB of swap space.

If you don't care about hibernation, unless you plan to use more than 32 GB on a regular basis, a small amount like 4 GB or 8 GB would be fine for now. Swap space can be resized later.


Quoting from Centos,

Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. While swap space can help machines with a small amount of RAM, it should not be considered a replacement for more RAM. Swap space is located on hard drives, which have a slower access time than physical memory.

If you're using Ubuntu as your primary OS and have 32GB, you need little to no swap space if you use Ubuntu for normal day-to-day tasks and not big rendering, server running, etc.

The reason why you've read about using swap space for lower levels of RAM is because in that case, swap space is used to fill in for the lack of RAM that they have. In your case with 32GB, and assuming that you're not using Ubuntu for really resource-heavy tasks, I would recommend 4 GB to 8 GB.


If you want to use suspend-to-disk, you need 34GB swap. If not, you not need swap space.

Tags:

Swap