Tested on Ubuntu Server 18.04, 20.04
Swap
is a portion of hard drive storage that has been set aside for the OS to temporarily store data that it can no longer hold in RAM.- The swap space on the hard drive will be used mainly when there is no longer sufficient space in RAM to hold in-use application data.
- Though the information written to disk will be significantly slower than information kept in RAM, the OS will prefer to keep running application data in memory and use swap for the older data.
It is believed that placing swap partitions on an SSD drive is not advisable, as it may harm the device. Actually, the write-cycle on modern SSDs is good enough that you'll likely replace the drive before it becomes a problem. Read this Reddit post, these AskUbuntu [one](https://askubuntu.com/questions/652337/why-are-swap-partitions-discouraged-on-ssd-drives-a