logoalt Hacker News

kees99today at 7:08 PM1 replyview on HN

zram is a good choice when data in RAM is very repetetive/compressible. Web browsers is one such load. Android apps is another good one.

When that data doesn't compress well at all, zram is no help and traditional swap-to-storage is a better choice.

And there is a middle-ground option, zswap: swapped out pages will eventually end up on a block device, but are compressed first.


Replies

fpolingtoday at 8:25 PM

Zram also supports a block device for pages that do not compress. So the primary advantage of zswap is that one can use its swap for hibernation while it does not work with zram.