Meta's CRAM compresses memory in RAM for up to 452x faster reads than ZRAM

Started by Stargazer86, Oct 10, 2026, 05:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Topic: Meta's CRAM compresses memory in RAM for up to 452x faster reads than ZRAM   Views(Read 55 times)

Stargazer86

Meta have presented a new Linux memory compression approach called CRAM, Tom's Hardware reports. The talk was at the Linux Plumbers Conference in Prague. Existing tools such as zswap and ZRAM work at the swap layer, treating compressed memory as a kind of block device. CRAM instead keeps compressed data in memory as a private NUMA node, using standard memory semantics

That difference matters. Because CRAM looks like ordinary memory to the kernel, Linux keeps features such as page migration and memory ballooning. It is also byte addressable, so reads run at DRAM speed. With ZRAM, every read of a compressed page has to go through the swap path and get decompressed first

The numbers are striking. The article reports up to 452 times the performance of ZRAM in read only cases. In the worst tested case CRAM managed about 489 million operations per second, against about 1.1 million for ZRAM. With 20% writes it was still about 5.4 times faster

Writes are the weak spot. When a compressed page is written to, it has to fault and migrate back to its original NUMA node, which takes time. There is also a mechanism called the Chicken Bit, which stops Linux using CRAM to prevent a cascading poison storm when writes outpace allocation. Working out how much usable RAM a system has when compressibility keeps changing is still an open research problem

The author is upfront that he relied on the session's slides and that his explanation might not be completely correct. So treat the details with some caution until there is a paper or kernel patches to read. He notes that ZRAM is widely used on devices like the Steam Deck. If CRAM makes it into the mainline kernel, everyday devices could see the benefit, not just Meta's data centres

Do you use ZRAM or zswap on any of your machines? And with RAM prices where they are, could tools like this make a difference for ordinary users?

First post, best pin

Mason0

ZRAM is on a couple of my old laptops and it makes a big difference. They only have 4GB of RAM and would be unusable with modern browsers otherwise

If CRAM gives better performance in the same situation, that would breathe even more life into old hardware. Fingers crossed it gets merged. Chromebooks use ZRAM heavily too. They would benefit as well

OffsideTrap66

Steam Deck users could see a nice boost if Valve adopts this. Games that hit the memory limit currently stutter as ZRAM works hard. Faster reads would smooth that out. It is a long way from conference talk to shipped product, though. Valve has been quick to adopt kernel improvements before

Pat73

Credit to the author for admitting his explanation might be off. Tech journalism on kernel internals is often confidently wrong. Linux Plumbers talks are usually recorded, so I will watch the full session. That is the best way to get the real details

Zidane

Chicken Bit and poison storm sound like names from a cartoon. Kernel developers do love a silly name. Behind the jokes there is a serious problem with running out of memory when compression suddenly gets worse

That needs to be very robust before it ships. Out of memory bugs are some of the nastiest to debug

James_80

Treating compressed memory as a NUMA node is a clever idea. NUMA support in Linux is mature and well tested, so they get a lot of features for free. It is the kind of solution that seems obvious once someone explains it. Those are often the best ones. Reusing existing machinery is good engineering
All original content unless stated

Scholar95

Bear in mind 452x is a best case for read only workloads. Real systems write a lot, and the 5.4x at 20% writes is the more honest number

That is still a big improvement, though. I would like to see results from mixed desktop use

Browsers and games write constantly, so the real gain might be smaller. Still worth having
Posted from my main account

Hawk

With DDR5 prices climbing because of AI demand, squeezing more out of existing RAM is worth a lot. Data centres will love this first. Consumers might benefit later through Android and SteamOS

Meta has every reason to push it upstream. Meta runs a lot of servers, so even small savings add up to millions
Just here for the craic :)