I would argue this article has its conclusion in reverse: for 99.9% of end users, zram is better, as hitting a disk swap means that something went very wrong anyway, and it's better to let the OOM killer do its job (a shame that the default one sucks hard).
Using zswap only makes sense in a server context, where very long-running processes, relative expendability of SSDs and very high concurrency completely change the optimal.
But now, people just parrot this article and paste it everywhere without taking time to stop and think about how it applies to different use cases.
From what I'm reading, zswap does the same thing as zram, except when it hits its limits and actually needs to swap to disk it has extra information about what's actually being accessed so it can push the least-recently-used memory to disk. Where when zram hits that point the kernel doesn't distinguish it from disk swap so your recent stuff gets pushed to disk and things you want fast end up slow.
> and it's better to let the OOM killer do its job
For most users this is the worst outcome, causing them to lose work.
I had Claude test zram vs zswap on a machine with a AMD 9800x3d, 32gb DDR5 and 4 sticks of Intel 16gb Optane as swap, and zram was substantially faster under simulated loads based on my coding agent workloads. Just one data point though. zswap is still generally considered the superior option.
I have a laptop with soldered RAM, a whole whopping 16GB of it. Without zswap or zram, it’s borderline unusable with web browsing, a bunch of terminals, mail client, etc. open. Maybe it’s a skill issue on my side, but only zram makes it work properly without hickups due to the OOM killer taking too long to kick in. Since switching from zswap to zram, I basically don’t encounter OOM situations and corresponding lockups anymore at all. Just my personal anecdote :)
Man my notebook has 2GB of RAM and I used either UBo + ZRAM or bundled adblocking from Waterfox just fine. The NUC with 8GB and ZRAM flies. WIth 16GB you shouldn't need ZRAM at all...
I guess that’s where the skill issue is coming in! That’s what I tried but probably my configuration wasn’t ideal. Maybe I should give it another shot!
Using zswap only makes sense in a server context, where very long-running processes, relative expendability of SSDs and very high concurrency completely change the optimal.
But now, people just parrot this article and paste it everywhere without taking time to stop and think about how it applies to different use cases.