# Swap For every operating system, there is a dedicated amount of RAM available that makes the processing of a program possible. However, the amount of this RAM is limited which is why RAM cannot hold a bulk of data in it. Therefore, there should be a backup option available which can support RAM whenever it runs out of memory. ``` sudo fallocate -l 1G /swapfile ``` ``` sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576 ``` ``` sudo chmod 600 /swapfile ``` ``` sudo mkswap /swapfile ``` ``` sudo swapon /swapfile ``` ``` vi /etc/fstab /swapfile swap swap defaults 0 0 ``` ``` sudo swapon --show ```