Here’s a detailed technical write-up on disabling ZRAM using Magisk, covering what ZRAM is, why you might want to disable it, and step-by-step methods to do so safely.
To confirm that ZRAM has been successfully disabled:
adb shell
su
cat /proc/swaps
/dev/block/zram0 ....Alternatively, you can check free memory using the command free -m or cat /proc/meminfo and look for the "Swap" line; it should show 0 total.
Before proceeding, ensure your device meets the following:
Warning: Modifying kernel memory parameters can lead to boot loops if done incorrectly. Always have a backup of your boot image or a way to disable Magisk modules via Safe Mode. disable zram magisk
To revert:
rm -rf /data/adb/modules/disable_zramOr, create a simple Magisk module that re-enables it (or just rely on system defaults after removal).
ZRAM is a feature of the Linux kernel (which powers Android) that creates a compressed block device inside your RAM. When your system runs out of physical memory, it compresses old or less-used pages and stores them in this ZRAM space instead of writing them to the slower internal storage (swap file).
In theory, ZRAM is a lifesaver for devices with 2GB–4GB of RAM, allowing more apps to stay open. However, in practice—especially on custom ROMs, gaming-focused setups, or high-RAM devices (8GB+)—ZRAM can cause overheating, CPU throttling, lag, and battery drain due to the constant compression/decompression cycle. Here’s a detailed technical write-up on disabling ZRAM
This is where Magisk—the systemless rooting interface—comes in. Using Magisk, we can disable ZRAM entirely without modifying the system partition. But be warned: Disabling ZRAM on a low-RAM device will cause apps to crash and reload frequently.
Who is this guide for?
Open your terminal emulator and type:
su
cat /proc/swaps
You will see output similar to:
Filename Type Size Used Priority
/dev/block/zram0 partition 2097152 102400 100
If you see /dev/block/zram0 (or zram1, etc.), ZRAM is active. The Size is in kilobytes (e.g., 2097152 KB = 2GB).
Alternatively, check ZRAM size with:
cat /sys/block/zram0/disksize
Make a note of the size—you may want to re-enable it later.
/data/adb/service.d/ using TWRP or ADB.