Compressed swap is a common lever to improve memory density, but there's a lot of confusion about how to best use it out there, and many people treat zram/zswap as two flavours of the same thing when they are really far more nuanced.

So what works, what doesn't, and why? In this article I go over the tradeoffs, the work we are doing upstream, and a little about what the future looks like. I am, as always, happy to answer questions :-)

https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html

Debunking zswap and zram myths

zswap and zram are fundamentally different approaches with different philosophies. If in doubt, use zswap.

@cdown nice! Do like your blog posts, was a fan of the swap one from way back :)
@cdown does use of zswap interfere with use of hibernation?

@jernej Yes! zswap works nicely with hibernation since it requires a disk-backed swap device anyway. In the zswap case, the same backing device is where the hibernation image goes. The zswap pool lives in RAM and is captured as part of the hibernation image, so nothing is lost.

Hibernating to swap on zram on the other hand is explicitly not supported, and logind (for example) actively blocks attempts to do so.

So zswap is actually the better choice if you care about hibernation.

@cdown Does anyone know which of these #NixOS uses? The option is confusingly named zramSwap soooo
@krutonium @cdown afaik if you do not declare the writeback device then its what the article says "zram", and "zswap" if such writeback device exists. disclaimer: i used to run zram on 100% of RAM space like fedora, but due to the oom hangs eventually switched it off. my systems never had a disk-backed swap. anecdotally, zram was mainly useful with Raspberry Pis.
@juuso @cdown That sounds like a reasonable answer, enough to probably be correct, so thank you :)