Swap is a space on a disk that is used when the amount of physical RAM memory is full. When a Linux system runs out of RAM, inactive pages are moved from the RAM to the swap space. Swap can be a dedicated swap partition or a swap file. In most cases a swap partition is not present on virtual machines, but we can create a swap file.