New Compressed RAM (CRAM) technology for Linux promises significant boost in memory performance
Read more
Tecnoblog
tecnoblog.net

New Compressed RAM (CRAM) technology for Linux promises significant boost in memory performance

The Compressed RAM (CRAM) project, proposed by engineer Grigory Pris, presents a solution for more efficient memory management in the Linux operating system. Unlike existing technologies ZRAM and Zswap, CRAM treats the compressed area as native RAM, which allows it to avoid using traditional or virtual swap and optimize data access.

At a presentation held at the Linux Plumbers Conference 2026, it was demonstrated that CRAM achieved performance 452 times greater than ZRAM. Grigory Pris's team, an engineer from Meta, introduced a concept capable of making the Linux kernel even more efficient when handling large volumes of data in RAM, especially under memory scarcity.

As the name suggests, CRAM is based on a new approach to compressing data directly in RAM. Although similar methods exist, two standards stand out in Linux: ZRAM and Zswap. Understanding their principles helps assess CRAM's advantages.

ZRAM creates a kind of virtual data block, mimicking a hard drive or SSD within RAM itself. When memory starts filling up, inactive or rarely used memory pages are compressed and moved into this block, thereby reducing RAM consumption. It is important to note that ZRAM functions as a swapping mechanism, using part of disk space as RAM extension, but it does so inside the RAM itself.

Zswap is similar in principle but more advanced. It intercepts attempts by the operating system to send memory pages to the actual swap (on HDD or SSD). Instead, the data of these pages is compressed and placed in specific areas of RAM. Only when memory approaches full capacity are the pages sent to the actual swap.

Despite ZRAM and Zswap being ingenious solutions, they face a potential performance issue. The dynamics of compressing and decompressing data for processing through swaps, whether real or virtual, are significantly slower than operations performed directly with RAM.

This is where CRAM steps in as a solution. Although CRAM superficially resembles ZRAM, the key difference is that in the first case, the block storing compressed data is treated as actual RAM, not as traditional swap. Linux begins to operate on this space as if it were an additional block of RAM, activating native kernel memory management mechanisms to work with the area containing compressed data.

These built-in features allow, under certain circumstances, access to compressed data without triggering a page fault—a situation where the system tries to access a memory page that is unavailable or unmapped, requiring kernel intervention. They also ensure page migration between addresses, reducing the risk of interruptions, among other benefits that positively affect performance.

How much exactly is the performance improved? At the Linux Plumbers Conference (LPC) 2026, Grigory Pris explained that in a specific benchmark, CRAM allowed for 489 million operations per second compared to 1.1 million operations per second for ZRAM. This means that in this test, CRAM was 452 times faster than classic ZRAM, and this was achieved without the need to create entirely new memory management infrastructure in Linux.

Although the level of performance may vary depending on the application, the trend indicates that CRAM will consistently demonstrate superior results. The project is promising, but excessive enthusiasm should be tempered, as CRAM development is not yet complete, and there is no planned official release date. It should also be noted that such a solution is likely to be geared towards professional applications running on servers, although it could potentially be useful for home use as well.

Popular