Meta Engineers Develop CRAM Linux Kernel Memory Compression
Meta is developing CRAM, a new Linux kernel feature designed to optimize memory compression and reduce overhead compared to existing zRAM and zswap solutions.
Meta engineers are developing CRAM, a new Linux kernel feature for memory compression. It serves as an alternative to zRAM and zswap.
The Linux kernel currently uses zRAM as a compressed block device in RAM and zswap as a compressed cache for swapped pages. CRAM proposes a different structure for handling compressed memory pages. The project addresses architectural limitations in how the kernel manages these segments to improve efficiency for systems under memory pressure.
One objective is optimizing the trade-off between CPU cycles and the memory footprint. While zRAM creates a separate block device requiring its own file system and swap management, CRAM integrates more directly into the memory subsystem. This design reduces overhead from the existing swap-to-block-device translation layer.
Technical discussions show CRAM focuses on page-level management of compressed data. By letting the kernel handle individual pages of compressed data more effectively, the project reduces fragmentation and improves memory reclamation speed. These changes provide more consistent performance for systems frequently swapping compressed data in and out of active memory.
