Meta's CRAM Brings Up to 452x ZRAM Read Performance to Linux
CRAM keeps compressed data in memory via a private NUMA node and includes a 'Chicken Bit' to stop Linux from using it during allocation management.
Meta engineers have presented CRAM, a new Linux memory compression model that keeps compressed data in memory rather than acting as a swap-layer feature, according to tomshardware.com. The design was conceptualized by Gregory Price and his team at Meta.
In read-only cases, CRAM offers up to 452x the performance of ZRAM. In the worst read-only case, it performs 489 million operations per second versus ZRAM's 1.1 million. With 20% writes enabled, CRAM is 5.4x faster than ZRAM in the worst tested case.
Rather than pretending to be a block device, CRAM uses a private NUMA node. A 'Chicken Bit' mechanism stops Linux from using CRAM while it manages allocations, a safeguard against cascading failures.
The design was presented at the Linux Plumbers' Conference in Prague. Zswap and ZRAM remain the most popular memory compression options in Linux and are fundamentally swap-layer features.
ZRAM and Zswap are used across the Linux ecosystem, including on machines like the Steam Deck, with many distributions enabling one by default.
Quick answers
What is CRAM?
CRAM is a new Linux memory compression model that keeps compressed data in memory instead of acting as a swap-layer feature. It was conceptualized by Gregory Price and his team at Meta.
How fast is CRAM compared to ZRAM?
CRAM offers up to 452x the performance of ZRAM in read-only cases. In the worst read-only case, it performs 489 million operations per second versus ZRAM's 1.1 million, and with 20% writes enabled it is 5.4x faster in the worst tested case.
Where was CRAM presented?
The CRAM presentation was given at the Linux Plumbers' Conference in Prague.