Swap partition

A swap partition is treated in Linux as the extension of RAM. Swap partitions are used as virtual memory when the system runs out of physical memory. Swapping occurs when a running process requires more RAM than there is available. One or more pages of RAM that have not been used recently are swapped out to make RAM available. Because disks are much slower than RAM, the more swapping occurs, the slower your system will be.

If you have a large amount of RAM, you probably won’t need to use the swap partition. However, if you’ve created the swap partition during the installation, you can use the swapon -s command to display information about the swap partition:

linux swapon command


The size of a swap partition is usually one to two times the system RAM size.
Geek University 2022