What Is Linux Swap Used for?
Contents 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...
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.
Is Linux swap necessary?
It is, however, always recommended to have a swap partition. Disk space is cheap. Set some of it aside as an overdraft for when your computer runs low on memory. If your computer is always low on memory and you are constantly using swap space, consider upgrading the memory on your computer.
Must Read
Should I disable Linux swap?
In case your server has sufficient RAM memory or does not require the use of swap space or the swapping greatly decreases your system performance, you should consider disabling the swap area.