Linux offers virtual memory support known as SWAP that is very common and reliable among the Linux systems. This feature is for computers with limited or minimum system resources that are being used for other processes as well. The ZSWAP is a kernel feature in the 3.8 version that compresses the swap cache and makes it possible for the system to never slow down as the SWAP file deals with the IO of HDD and if continuously used, it may result in a performance drop down of the hard disk.
The ZSWAP actually compresses the SWAP file and improves the performance of the Linux system. It is very easy to setup ZSWAP on Linux, all you need is to follow a few simple steps to enable SWAP.
It is an optional Linux kernel parameter so it is not found in the settings, you need to work with the bootloader to enable ZSWAP. While using Ubuntu, you need to use GRUB so to access the Grub configurations. It is necessary to back up the Grub configurations so if anything goes wrong, you can easily reverse back to the previous settings. It is a command-line argument.
To backup Grub, get the root access using su or sudo -s command in the terminal. In the Root shell, use the CP command to make a backup of the Grub configuration file.
cp /etc/default/grub /etc/default/grub.bak
Enabling Zswap in Ubuntu
When the Grub configurations are backed up, you need to open it in the Nano to edit.
nano -w /etc/default/grub
In the Nano editor, find the GRUB_CMDLINE_LINUX_DEFAULT.
It has different command-line arguments including quiet splash and various others. All you need is to add an additional argument at the end.
Ubuntu Zswap Grub Configuration File
Use Ctrl + O to save the file and exit using Ctrl + X hotkeys. Update the Grub bootloader using command sudo update-grub