Add Swap Space To System
We can add swap space to the system by following method -
Check for existing swap space
$ sudo swapon --showCreate a new swap space
$ sudo fallocate -l 2G /swapfile
$ sudo chmod 600 /swapfileEnable swap space
$ sudo mkswap /swapfile
$ sudo swapon /swapfileVerify that the swap space exists
$ sudo swapon --showMake swap persistent upon restart
$ echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstabSource: DigitalOcean
Last updated