ZRAM-GENERATOR.CONF(5) File Formats Manual ZRAM-GENERATOR.CONF(5) (NAME) zram-generator.conf - systemd zram (SYNOPSIS) /usr/lib/systemd/zram-generator.conf /usr/local/lib/systemd/zram-generator.conf /etc/systemd/zram-generator.conf /run/systemd/zram-generator.conf /usr/lib/systemd/zram-generator.conf.d/*.conf /usr/local/lib/systemd/zram-generator.conf.d/*.conf /etc/systemd/zram-generator.conf.d/*.conf /run/systemd/zram-generator.conf.d/*.conf (DESCRIPTION) zram-generator(8) . systemd.syntax(5) . (CONFIGURATION DIRECTORIES AND PRECEDENCE) . /usr/share/zram-generator/zram-generator.conf.example . /usr/lib/systemd/zram-generator.conf.d/ . /etc/ . . *.conf.d/ . . . /dev/null /etc/ . : systemd.zram[=0|1]. ( ) zram0 . . zram . . (OPTIONS) [zramN] N . DIRECTIVES . . 0 . o host-memory-limit= ( MemTotal /proc/meminfo proc(5)) . none . none . o zram-size= zram MemTotal ( ram) . DIRECTIVES . (^%/*-+) e SI ()log() int() ceil() floor() round() abs() min() max . min(ram / 2, 4096) . o zram-resident-limit= zram ( 0 ) MemTotal ( ram) . zram-size . 0 . o compression-algorithm= zram . . /sys/block/zram0/comp_algorithm ( .../recomp_algorithm) . . (recompression) . .../algorithm_params ( .../recompress) . . o writeback-device= (writeback). /sys/block/zramX/backing_dev . /dev/disk/by-partuuid/2d54ffa0-01 /dev/zvol/tarta-zoot/swap-writeback . RAM . o swap-priority= (swap) -1 32767. . 100 . o mount-point= ( ) (mount) . fs-type= . : (unmount) ( ). o fs-type= . mount-point ext2 swap . ( fs-type= mount-point= .) : ( ). systemd-makefs(8) . o options= mount swapon . fs-type . discard . (DIRECTIVES) ( ) : o set!variable=program program (3)system ( zram-size/zram-resident-limit) variable !set zram-size / zram-resident-limit . (ENVIRONMENT VARIABLES) ZRAM_GENERATOR_ROOT /proc/meminfo $ZRAM_GENERATOR_ROOT/proc/meminfo {/usr/lib,/usr/local/lib,/etc,/run}/systemd/zram-generator.conf $ZRAM_GENERATOR_ROOT/{/usr/lib,/usr/local/lib,/etc,/run}/systemd/zram-generator.conf . (EXAMPLES) : zram device size ^ | 4G>| ooooooooooooo | o | o | o 2G>| o | o | o 512M>| o 0> total usable RAM ^ ^ ^ 1G 4G 8G : : : zram-size = min(min(ram, 4096) + max(ram - 4096, 0) / 2, 32 * 1024) zram device size ^ 32G>| oooooooooooooo | o 30G>| o | /=/ | 8G>| o | o | o | o | o 4G>| o | o | o 1G>| o 0||> total usable RAM ^ ^ ^ ^ ^ ^ ^ 1G 4G 8G 12G 56G 60G 64G (OBSOLETE OPTIONS) o memory-limit= host-memory-limit. o zram-fraction= zram . . 0.5 . max-zram-size zram-size . o max-zram-size= zram zram-fraction . none . 4096 . zram-fraction zram-size . (REPORTING BUGS) https://github.com/systemd/zram-generator/issues (SEE ALSO) zram-generator(8), systemd.syntax(5), proc(5) https://github.com/systemd/zram-generator zram: https://kernel.org/doc/html/latest/admin-guide/blockdev/zram.html sysfs ABI zram: https://kernel.org/doc/Documentation/ABI/testing/sysfs-block-zram fasteval zram-size: https://docs.rs/fasteval/0.2.4/fasteval/#the-fasteval-expression-mini-language zram-generator developers December 2024 ZRAM-GENERATOR.CONF(5)