Disable Zram Magisk ✦

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


Table of Contents

  1. What is ZRAM and How Does It Work?
  2. Why Disable ZRAM? Pros and Cons
  3. Prerequisites: Root and Magisk
  4. Method 1: Using a Magisk Module (The Easiest Way)
  5. Method 2: Manual Disable via Terminal (Temporary)
  6. Method 3: Creating a Persistent Magisk Script
  7. Verifying That ZRAM Is Disabled
  8. Troubleshooting Common Issues
  9. Re-Enabling ZRAM
  10. Conclusion

3.2 Module Structure

Create a folder named disable_zram containing the following structure:

disable_zram/
├── module.prop
└── service.sh

5. Impact Analysis

Disabling ZRAM results in a trade-off between memory capacity and processing speed. How to Disable zRAM via Magisk for Enhanced

Downsides of Disabling ZRAM

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.


Via Magisk

Method A — Magisk module (recommended)

  1. Create module folder structure on device or PC:

    • /sdcard/DisableZram/ (temporary build folder)
    • Inside it create: system/bin, META-INF/com/google/android/update-binary (optional), and module.prop
  2. module.prop (example)

id=disablezram
name=Disable ZRAM
version=1.0
versionCode=1
author=You
description=Disables zram at boot
  1. Script to stop/disable zram at boot: place as system/bin/disable-zram.sh and make executable (0755)
#!/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
  1. service script to run at boot: place at system/etc/init.d/99disablezram (or add a post-fs-data script depending on Magisk version). Example post-fs-data.sh in system/bin with executable permissions:
#!/system/bin/sh
/system/bin/disable-zram.sh &
  1. Package and install:

    • Zip the module folder (DisableZram.zip) with root-level folder structure matching Magisk Module spec (module.prop at root and system/ folder).
    • In Magisk Manager, install the module zip and reboot.
  2. Verification:

    • After reboot: run cat /sys/block/zram0/stat or ls /sys/block/ | grep zram — files should be absent or show zeros.
    • Use dmesg or logcat to confirm zram not initialized.
  3. Revert:

    • Disable/uninstall module from Magisk Manager and reboot.

Step 3: Create the Service Script

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