knowledge › Arch Linux

Compressed Memory

If you're like me and you made the terrible decision of buying a laptop with 8GB of memory then this is for you. Install zswap. Heavily inspired (stolen) from Peter Roberts article.

First, grab the systemd package for using and configuring zswap

sudo pacman -S systemd-swap

Enable 300% compression over the default 200%

sudo sh -c 'echo -n zswap_zpool=z3fold > /etc/systemd/swap.conf.d/zswap.conf'

Enable the service at boot and start it immediately

sudo systemctl enable --now systemd-swap

Check that the settings have applied correctly, see this article for more.

sudo grep -R . /sys/module/zswap/parameters

Check what zswap is doing with your memory

sudo grep -R . /sys/kernel/debug/zswap