How to Disable zRAM via Magisk for Enhanced Android Performance
If you are a power user or gamer with a high-end Android device, you might find that zRAM—while useful for low-memory phones—actually introduces unnecessary CPU overhead on your powerful hardware. Disabling it can lead to a snappier interface, better battery life, and more consistent frame rates in heavy games.
Using Magisk is the safest way to achieve this, as it allows you to modify system behavior without permanently altering your /system partition. Understanding zRAM: Why You Might Want it Gone
zRAM creates a compressed block device within your physical RAM. When memory runs low, Android compresses inactive data and moves it into this "swap" area.
The Benefit: It allows devices with 2GB–4GB of RAM to keep more apps open. disable zram magisk
The Drawback: The constant compression and decompression require CPU cycles, which can cause micro-stutters and increased battery drain on devices that already have 8GB–16GB of RAM and don't need the extra space. Method 1: Use a Dedicated Magisk Module (Recommended)
The most reliable way to disable zRAM is to use a module that targets swap and zRAM at boot. [ALL] [MOD/Other] Disable/Enable *SWAP *zRam *Fstrim
Create a folder named disable_zram containing the following structure:
disable_zram/
├── module.prop
└── service.sh
Disabling ZRAM results in a trade-off between memory capacity and processing speed. How to Disable zRAM via Magisk for Enhanced
Verdict: If you have 6 GB of RAM or more and you’re not a heavy split-screen user, disabling ZRAM is safe and can improve raw performance.
/data/adb/service.d/.Create module folder structure on device or PC:
module.prop (example)
id=disablezram
name=Disable ZRAM
version=1.0
versionCode=1
author=You
description=Disables zram at boot
#!/system/bin/sh
# Stop zram if active and disable it
if [ -e /sys/block/zram0/reset ]; then
echo 1 > /sys/block/zram0/reset 2>/dev/null || true
fi
for d in /sys/block/zram*; do
[ -e "$d/disksize" ] && echo 0 > "$d/disksize" 2>/dev/null || true
done
# Unload zram module if possible
/sbin/modprobe -r zram 2>/dev/null || /system/bin/rmmod zram 2>/dev/null || true
#!/system/bin/sh
/system/bin/disable-zram.sh &
Package and install:
Verification:
cat /sys/block/zram0/stat or ls /sys/block/ | grep zram — files should be absent or show zeros.dmesg or logcat to confirm zram not initialized.Revert:
Inside the same folder, create a text file named service.sh. Paste the following commands into it:
#!/system/bin/sh
# Wait for the system to settle
sleep 10