Debunking zswap and zram myths
Debunking zswap and zram mythstl;dr:If in doubt, prefer to use zswap. Only use zram if you have a highly specific reason to.In terms of architecture:zswap sits in front of your disk swap, compresses pages in RAM, and automatically tiers cold data to disk. It integrates directly with the kernel’s memory management and distributes pressure gracefully.zram is a compressed RAM block device with a hard capacity limit. When you put swap on it and it fills up, there is no automatic eviction, and the kernel has very little leverage to do anything about the situation. The system either OOMs or falls back to lower-priority swap, causing LRU inversion (see below). It only really makes sense for extremely memory-constrained embedded systems, diskless setups, or cases with specific security…