Zram, zswap and Linux Swap: A Practical Configuration Guide
In part 1 of this series I made the case for measuring memory pressure before spending money on RAM that now costs more than four times what it did a year ago. If your measurements showed short, compressible peaks — cold pages sitting around while the active working set fits fine — this is the post where compression earns its keep. I want to be upfront about one thing, because “just enable zram” has become the reflexive advice in every forum thread about low memory: zram and zswap do not create free memory. They spend CPU cycles compressing pages you are not actively using. When the data compresses well and the CPU has headroom, that trade is excellent. When it doesn’t, you’ve added a layer of complexity and gained nothing. So the goal here is not to enable everything — it’s to pick one mechanism deliberately and prove it helps. ...