If you want to use and control swap on Ubuntu or its other variants then you can use GParted as a easy way to enable or disable Swap. Firstly you’ll have to install the GParted package to your Ubuntu installation. GParted is available on Ubuntu Live CD but isn’t included when Ubuntu is installed on your PC.
You can get GParted installed from the Ubuntu Software Manager or by pressing “sudo apt-get install gparted” on Ubuntu Terminal. This will install GParted onto your Ubuntu System. Now lets run and check the partitions of your computer.
Once Gparted finishes loading all the partitions of the hard drive. Left click on the partition labeled as linux-swap, and choose swapoff or swapon. As it may already be clear that swapoff would turn off the swap usage and swapon would turn on the use of swap partition space.