

I have the same experience. I don’t really understand why tbh. I have looked at some of the kernel code but I wasn’t able to understand it.
My experience is that zram has vastly more aggressive compression and can compress way more data. Zram will happily sit there and compress 7 gb of data into 1.5 gb, whereas zswap never hits those numbers.
So I disagree with the common takes about swap being needed with zram. Because zram will compress everything that would otherwise be put into swap, into the same amount of space zswap will use to store a fourth of that data, whereas everything else would be put into swap. And because decompressing is faster than swapping, it leads to a smoother experience.

















I think the problem is they analyze it by how it appears to work rather than measuring raw numbers. Because honestly, I don’t really understand why zram compresses better either.
Because the interactive diagram on that blogpost below “LRU inversion” is interesting, and it’s a great example of what should happen, but it’s not accurate to my experience. What actually happens, IME, is that 1, 2, 3, 4, 5, 6, , 8, 9, 10, 11, 12 stay in zram forever and never get swapped to disk. Even when I had 8 gb of ram (on the mac mini) I had that experience.