Swap is extra space which is used when the physical memory (RAM) running out of space or full. When the system needs extra memory and the RAM is full that time inactive pages in RAM memory will move to the swap storage.
You can also call Swap as another small RAM which helps to boost performance while physical ram running out of space.
Benefits of SWAP memory:
- Provide extra space when physical memory full
- Move not-so-needed items from high-speed memory
- Allow to hibernate which means without swap hibernation is not possible on Linux.
- Consume disk space on server
- Not necessarily improve performance
Let's check the steps to create or add new Swap partition on Linux systems.
1. Check for Swap Memory
Before we start with the swap creation process use below command to make sure no swap memory is available on the system.