Overview
ZRAM is an essential Linux kernel feature that creates a virtual compressed block device inside physical RAM. By compressing inactive memory pages rather than writing them to slow flash storage, ZRAM effectively expands usable RAM and keeps applications alive in the background.
However, stock Android kernels are typically locked to standard lz4 or lzo-rle compression algorithms, and fixed ZRAM sizes cannot easily be altered without recompiling the entire boot image. Furthermore, custom kernel developers who compile optimized out-of-tree compression drivers (such as lz4kd or zstdn) face challenges distributing these drivers cleanly.
Developed by FurLC, ZRAM-Module is a specialized performance utility for Magisk and KernelSU. It automates the loading of custom compression kernel modules (.ko) during early startup and configures custom ZRAM block sizes systemlessly.
Key Capabilities
- Automated
.koDriver Insertion: The module searches its internal directory during early boot and executesinsmod/modprobeon bundled compression algorithm drivers (such aslz4kd.koorzstdn.ko). - Dynamic Algorithm Binding: Once the driver is registered in the kernel crypto API, the module binds it directly to
/sys/block/zram0/comp_algorithm. - Flexible Sizing: Allows users to specify an exact ZRAM block size (e.g., 4GB, 6GB, 8GB) before initializing
swapon. - Ideal for Custom Kernels: Perfect for users running custom kernels designed for performance and low-latency gaming.
Installation & Configuration
- Download the latest
ZRAM-Module-v*.ziparchive from GitHub releases. - Install the package in Magisk or KernelSU.
- Reboot your device.
- Verify the active compression algorithm and ZRAM allocation in Termux:
su -c cat /sys/block/zram0/comp_algorithm su -c free -m
