Loading...
Loading...
Linux memory compression tools zram and zswap can stretch limited RAM as hardware prices rise; a recent patch promises up to 50% faster zram operations. The Register explains both systems: they augment traditional swap (disk-based paging) by compressing memory pages to reduce disk I/O and save space. zram creates an in-RAM compressed block device for swap, while zswap acts as a compressed cache between RAM and disk swap. The article warns against disabling swap entirely, likening swap to an elas
A Linux kernel memory-management expert argues zswap is the safer default and zram should be used only for specific cases. zswap compresses pages in RAM and seamlessly tiers cold data to disk, integrating with the kernel’s reclaim and avoiding LRU inversion. zram creates a compressed RAM block device with a hard capacity limit; when full it can cause OOMs or force fallback to slower disk swap, worsen performance by filling fast RAM with cold pages, and break cgroup accounting on servers. The author advises against running zram alongside disk swap, recommends pairing zram with a userspace OOM manager if used, and reserves zram for embedded, diskless, or security-sensitive setups. This matters for admins optimizing performance and isolation on desktops and servers.
A Hacker News thread highlights a blog post titled “Debunking Zswap and Zram Myths,” sparking discussion about using compressed RAM-based swap (zram) and swap-backed compression cache (zswap). Commenters recall early SSD wear concerns that led users to put swap on zram, noting setups could be tedious. The exchange revisits trade-offs: performance benefits of reduced I/O and lower wear on flash, versus memory pressure and configuration complexity. Key players are the Linux kernel features zram and zswap and the broader Linux user community. This matters for system administrators, laptop users, and developers optimizing performance and SSD longevity on resource-constrained devices.
A kernel memory expert argues zswap is the safer default for most Linux systems and warns against indiscriminate use of zram. zswap compresses pages in RAM and can spill cold data to disk, integrating with kernel memory management to avoid LRU inversion and graceful pressure handling. zram provides a compressed RAM block device with a fixed capacity; when it fills it can block eviction, trigger long hangs or OOMs, break cgroup accounting, and cause active performance regressions when used alongside disk swap. The author recommends preferring zswap, avoiding zram with disk swap, and if using zram pairing it with a userspace OOM manager; zram remains suitable for small embedded, diskless, or strict data-at-rest scenarios.
Debunking zswap and zram myths
Linux memory compression tools zram and zswap can stretch limited RAM as hardware prices rise; a recent patch promises up to 50% faster zram operations. The Register explains both systems: they augment traditional swap (disk-based paging) by compressing memory pages to reduce disk I/O and save space. zram creates an in-RAM compressed block device for swap, while zswap acts as a compressed cache between RAM and disk swap. The article warns against disabling swap entirely, likening swap to an elastic waistband that prevents crashes under edge conditions, and discusses practical swap types (swap file vs partition) and placement strategies across drives. The piece is timely as RAM costs climb and users seek software techniques to maximize existing memory.