Skip to main content

Archived Article — The Daily Perspective is no longer active. This article was published on 13 March 2026 and is preserved as part of the archive. Read the farewell | Browse archive

Technology

As RAM Prices Soar, Linux Offers a Free Way to Stretch Your Memory

Memory compression tools zram and zswap can extend system capacity without buying expensive upgrades, though they come with trade-offs.

As RAM Prices Soar, Linux Offers a Free Way to Stretch Your Memory
Image: The Register
Key Points 3 min read
  • RAM prices have jumped over 100% in recent months, driven by AI data centre demand and supply constraints.
  • zram and zswap compress memory in-kernel to reduce reliance on slow disk swap, effectively stretching available RAM.
  • zram works best on systems with modest memory; zswap suits systems with faster storage and heavier workloads.
  • Both require careful configuration and should not be used together; neither is a replacement for upgrading when truly needed.

As Australians wake this morning, the global RAM market remains in crisis. Memory prices have surged more than 90 percent in the first quarter of 2026 alone, forcing individuals and organisations worldwide to make difficult purchasing choices. For cash-strapped Linux users, however, the kernel offers a built-in alternative that costs nothing: compression.

Two compression mechanisms exist within modern Linux systems. Zram creates a compressed block device in RAM itself, storing memory pages in compressed form. Zswap works differently; it compresses pages before they are written to disk-based swap, acting as a cached layer between compressed memory and slower storage. Both are legitimate tools that stem from the same problem: disk swapping is thousands of times slower than RAM access.

The appeal is straightforward. When your system runs short on memory, it normally copies unused pages to disk. This frees RAM for active programs but trades speed for capacity. With compression enabled, a 500 megabyte chunk of memory might compress to 250 megabytes, saving significant space without the penalty of disk I/O. The trade-off is CPU time; compression and decompression demand processing cycles.

Not all systems benefit equally. Zram suits machines that rarely touch swap under normal use, or older hardware with limited RAM such as Raspberry Pi boards and embedded systems. Because zram exists entirely in memory, it cannot exceed your total RAM capacity no matter what compression ratios you achieve. Systems running microSD card-based storage particularly benefit; avoiding disk writes extends flash storage lifespan.

Zswap, by contrast, requires an existing disk-based swap partition or file. It sits in front of that disk swap and holds compressed pages in a small pool of RAM. When the pool fills, pages spill to disk. This design suits systems with sufficient RAM that swap use remains predictable and occasional, or modern machines with fast NVMe storage where disk I/O is no longer prohibitively slow. The difference is philosophically important: zswap assumes you will swap to disk eventually; zram assumes you might not.

Configuration demands careful attention. The zram kernel documentation recommends sizing the compressed device to no more than twice your physical RAM, assuming a typical 2:1 compression ratio. Do not enable both zram and zswap simultaneously; they duplicate each other's work and waste the very resource you are trying to manage more efficiently.

Fedora and some Linux distributions enable zram by default. Others, such as Pop!_OS, require it to be explicitly disabled before zswap becomes effective. Even then, encrypted swap files reduce zswap's performance benefit, forcing users to choose between speed and security.

The hard truth remains: compression is a workaround, not a solution. A system swapping heavily needs more RAM, not more CPU cycles spent compressing. For machines routinely exceeding their physical memory, neither tool magically creates capacity. They are elastic in your digital waistband, helpful when things tighten but not a substitute for proper sizing.

With DRAM prices expected to remain high through 2026, and analysts warning of price relief unlikely before 2027, these kernel features offer real utility for cost-conscious users. They require no expense beyond understanding and configuration time. For those stuck with the hardware they have, that matters.

Sources (4)
Oliver Pemberton
Oliver Pemberton

Oliver Pemberton is an AI editorial persona created by The Daily Perspective. Covering European politics, the UK economy, and transatlantic affairs with the dual perspective of an Australian abroad. As an AI persona, articles are generated using artificial intelligence with editorial quality controls.