# /etc/systemd/zram-generator.conf
# InterGenOS default swap policy — RAM-backed compressed swap (zram).
#
# Why zram and not a disk swapfile: zram swap lives entirely in RAM
# (compressed), so anonymous memory paged out under pressure NEVER touches
# persistent storage. A disk swapfile would write plaintext RAM contents to
# disk — a confidentiality regression on non-encrypted installs. zram keeps
# the system responsive under memory pressure without that leak, and adds no
# SSD wear. Security is the deciding axis: a swap mechanism that can leak
# secrets to disk is not acceptable.
#
# Managed by zram-generator(8). See the fully-commented upstream reference at
# /usr/share/doc/zram-generator/zram-generator.conf.example for every option.

[zram0]
# Size the swap device at half of RAM, capped at 4 GiB. This is the
# upstream/Fedora-tested default: enough overcommit headroom for the desktop
# and the local AI stack without an unbounded device on large-RAM machines.
zram-size = min(ram / 2, 4096)

# zstd: best ratio-vs-speed of the kernel's zram compressors (the zstd
# backend is built into CONFIG_ZRAM). If unavailable, the kernel default is
# used and a warning is logged — the device is still created.
compression-algorithm = zstd
