{
  "slug": "zram",
  "term": "zram",
  "aliases": [
    "Linux zram",
    "Compressed RAM block device"
  ],
  "definition": "zram is a Linux block-device driver that provides compressed RAM-backed storage with optional writeback to a configured backing device.",
  "note": "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. [zram-v612]\n\nWith 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. [zram-v612]\n\nIn 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. [zram-code-v612]",
  "related": [
    "tmpfs",
    "zswap"
  ],
  "citations": [
    {
      "id": "zram-v612",
      "title": "Linux 6.12: zram, memory accounting and optional writeback",
      "url": "https://docs.kernel.org/6.12/admin-guide/blockdev/zram.html",
      "accessed": "2026-11-14"
    },
    {
      "id": "zram-code-v612",
      "title": "Linux v6.12 zram driver: pool accounting, slot table and same-filled pages",
      "url": "https://raw.githubusercontent.com/torvalds/linux/v6.12/drivers/block/zram/zram_drv.c",
      "accessed": "2026-11-14"
    }
  ],
  "advantages": [],
  "limitations": [],
  "provenance": [
    "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."
  ],
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-14"
}
