Chris Down has worked on Linux kernel memory management and swap code for close to a decade. This is the clearest write-up on zswap vs zram I’ve read so far.
His short answer: if in doubt, use zswap. Only use zram if you have a specific reason to.
A few points from his article that matter even if you’ve run zram for years:
- Don’t run zram alongside disk swap. Cold pages fill zram first and stay there, while the pages you’re actively using get pushed to the slower disk.
- zram on servers is a hard sell. zram memory isn’t charged to any cgroup, so it breaks memory limits and isolation between services and containers.
- zram doesn’t automatically mean less disk I/O. It squeezes the page cache, which can lead to more file rereads from disk.
- If you use zram, run a userspace OOM daemon like systemd-oomd or earlyoom. Without one, the system can hang for minutes before the kernel’s OOM killer acts.
I first published I was wrong! zswap IS better than zram on September 1, 2025, after moving my own desktop from zram to zswap:
Chris’s article reaches the same conclusion and goes much deeper into the why. So I’ve updated mine today to better line up with his: revised server advice, a few corrected table rows, and a warning about mixing zram with disk swap. Each change is marked “Updated” so you can see what changed.
Have you switched from zram to zswap, or do you still have a good reason to stay on zram?
Let us know below and also see related discussion which I’m connection both topics here: