First disable the swap and delete it
sudo swapoff /swapfile sudo rm /swapfileCreate new swap space of size 16 GB (16 * 1024 = 16384).
bsis the block size. Basically bs * count = bytes to be allocated (in this case 16 GB). Here bs = 1M (M stands for mega, so we are assigning 1MB block size) and we are allocating 16384 * 1MB (=16GB) to swap.sudo dd if=/dev/zero of=/swapfile bs=1M count=16384Give it the read/write permission for root
sudo chmod 600 /swapfileFormat it to swap
sudo mkswap /swapfileTurn on swap again
sudo swapon /swapfileNow reboot the PC for the above changes to take place.