ZRAM Swap Planner
Size a zram swap device from RAM, a device share and an expected compression ratio, and see how much RAM the swap really returns.
| Swap device (disksize) | |
|---|---|
| Pages stored | |
| Compressed data | |
| Metadata (about 0.1 % of the device) | |
| RAM used | |
| RAM freed | |
| Memory limit (mem_limit) | |
| Ratio to fill the device |
—
zram keeps swapped pages compressed in RAM instead of writing them to a disk: a page swapped out frees its uncompressed size and costs its compressed size plus a small metadata table, so the ratio decides whether the device is a saving at all. The kernel notes there is little point sizing a device above twice RAM at the expected 2:1, because the metadata is allocated for the whole device whether or not it fills. Incompressible data compresses at about 1:1 and gains nothing; check mm_stat (compr_data_size against orig_data_size) on a running system to see the real ratio. zswap, which keeps a compressed cache in front of a disk-backed swap, is a different mechanism and is not modelled here. Everything is computed in your browser; nothing is sent anywhere else.