Swap
2026-04-17
Edited: 2026-04-17
Main takeaway seems to be that zswap is preferred over zram, unless you are resource constrained or running a oomd daemon. Some other interesting bits of information
- swap is not emergency memory but rather for reclaiming memory
- under low memory contention the swap as an optimization by storing less-used anonymous memory
- under high memory contention the swap can be used to reclaim pages, which will otherwise be locked to the memory without swap
In particular, zram does that have tiering that zswap has. That is, zswap is managed by the kernel while zram is not: zswap tiers between faster compressed ram or slower disk. Also zram apparently suffers from LRU inversion.
The advice for using zram is to follow Fedora's direction, use 100% of RAM as zram size and use an oomd daemon. It seems in the future zswap might be preferred, especially with virtual swap device which removes the need for a separate device for swap.
References: