Disable Zram - Magisk
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.
# Log output (optional, viewable via 'dmesg' or logcat) log -t "MagiskZRAM" "ZRAM has been disabled and reset." else log -t "MagiskZRAM" "ZRAM device not found." fi4. Verification
To confirm the module is active and ZRAM is disabled: disable zram magisk
: On devices with high physical RAM (e.g., 12GB+), disabling zRAM can reduce CPU overhead caused by constant compression/decompression. Here’s a detailed technical write-up on disabling ZRAM
7. Potential Issues & Troubleshooting
| Problem | Likely Cause | Fix |
|---------|--------------|-----|
| ZRAM still active after disable | Kernel re-initializes ZRAM later (e.g., via init.qcom.rc or vendor scripts) | Use post-fs-data.sh instead of service.sh or increase sleep time |
| Bootloop | Aggressive removal breaking memory management | Boot to safe mode (vol down during boot) and delete module from /data/adb/modules via TWRP or adb |
| Apps keep reloading | Device needs ZRAM due to low memory | Re-enable ZRAM, reduce swappiness instead of disabling fully |
| Module not executing | Wrong path or permissions | Ensure scripts are 755 and located correctly. Check logcat \| grep magisk | DevCheck → Memory tab → "ZRAM size" should be 0
zRAM Swap Manager: A more granular script-based tool. You can acquire it and read its documentation on the VR-25 zram-swap-manager GitHub Repository. To use it to disable zRAM, you edit its configuration file at /data/adb/vr25/zram-swap-manager-data/config.txt and add swap_off; exit. 💻 Option 2: Build Your Own Minimal Magisk Module
7. Conclusion
Disabling ZRAM via Magisk is a viable optimization strategy for devices with sufficient physical RAM (typically 8GB or more) or for older devices where CPU performance is the bottleneck rather than memory capacity.
Check via Device Info Apps
- DevCheck → Memory tab → "ZRAM size" should be 0.
- CPU Float → Show swap usage → should be 0 MB.