Idle pages being parked on a device to free room in RAM.

Swap gives memory a slow extra layer

Swap is not extra memory. It is a bet: the kernel picks pages it predicts will not be needed soon, writes them to a device, and frees the RAM. When the prediction holds, a spike passes without killing a process. When it does not, every wrong guess costs a device round trip, three to five orders of magnitude above reading RAM. ...

November 25, 2026 · 5 min · XB Field Notes
A compressed block device inside RAM storing pages that would otherwise go to disk.

zram squeezes swap into RAM

When memory tightens, cold pages would go to a slow disk. zram keeps them in compressed RAM instead, trading a little CPU for much more headroom. A compressed block device in memory zram is a block device that lives in RAM and stores compressed data instead of talking to a real disk. When the kernel swaps a page into it, the page is compressed and kept in memory, so the memory gain comes from shrinking the pages rather than moving them to slow storage. Because the device is memory-backed, it answers reads and writes far faster than a disk-backed swap, but the space it provides is limited by how compressible the pages are and by how much memory you are willing to trade for the swap. ...

November 24, 2026 · 5 min · XB Field Notes