Firstly, create a file of 500MB using 'dd'
dd if=/dev/zero of=/home/swapfile bs=1k count=500000then set appropriate permissions for the filechmod 600 swapfilemake it a swap filemkswap swapfileand finally activate itswapon swapfileThat's it, you have just added 500MB of swap space. You can check the swap size using the 'free' command. In future if you want to remove the swap space, then do the followingturn swap off
swapoff swapfiledelete the filerm swapfileThat's it.