This tutorial shows how to enable zswap kernel module to increase usable RAM in your Ubuntu computer or laptop.
As you know, Ubuntu Linux usually includes a swap space (either disk partition or swap file) on the disk. It can be used for hibernation, and as extended memory space. When the system needs more memory resources and the RAM is going full, then the inactive pages in memory are moved to the swap space.
Swap space can be helpful for computers with limited RAM. But, it’s slow! Too much swap in use will slow down the overall system performance.
As workarounds, Linux includes 2 kernel modules: zram and zswap. Instead of moving inactive pages from memory to disk (swap space), they do similar things by compressing the data into dynamically allocated RAM space.
As the data is compressed, it takes less physical memory space which makes your RAM even more usable. While, keeping the system running smoothly because reading from compressed data in RAM is usually faster than reading from swap on disk.
Continue Reading…