zram · shipping · also Linux zram, Compressed RAM block device

zram

zram is a Linux block-device driver that provides compressed RAM-backed storage with optional writeback to a configured backing device.

Related Observatory article: zram on hesela.com

A zram device can hold a filesystem or serve as swap. Its logical disksize differs from compressed payload size and actual RAM allocation. The mm_stat counters distinguish represented data, compressed payload and allocator usage; mem_limit controls the pool separately. [1]

With CONFIG_ZRAM_WRITEBACK and a configured backing device, selected pages can be written out of RAM. Consequently, neither the device name nor its logical capacity proves that all data remains in RAM. [1]

In Linux v6.12, mem_used_total counts zsmalloc pool pages; the per-slot table is allocated separately. Same-filled pages retain a repeated word in that table without allocating a payload object. Zero payload allocation therefore does not imply zero device memory cost. [2]

Relations

related
tmpfs, zswap

Citations

  1. Linux 6.12: zram, memory accounting and optional writeback (accessed 2026-11-14)
  2. Linux v6.12 zram driver: pool accounting, slot table and same-filled pages (accessed 2026-11-14)
Sources & caveats
  • Linux 6.12 documentation: usage, statistics and writeback sections; no compression ratio or workload speedup is assumed.
  • Driver inspection of mm_stat_show, zram_meta_alloc and zram_write_page qualifies the memory-accounting scope; no allocation experiment was run.

JSON: /data/terms/zram.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. zram. Hesela. 2026-11-14. https://hesela.dev/terms/zram/