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 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 :)