Disable Zram Magisk (Original - STRATEGY)

If you don’t want a persistent module, you can run a script manually after each reboot, but that’s tedious. Instead, use adb or terminal to disable ZRAM on-the-fly (non-permanent):

su
swapoff /dev/block/zram0
echo 0 > /sys/block/zram0/disksize

To make it permanent without a module, add the commands to /data/adb/service.d/ (create the folder if missing). Magisk automatically executes any script in service.d with .sh extension.


For a permanent solution that survives reboots, create a custom boot script managed by Magisk. disable zram magisk

until [ "$(getprop sys.boot_completed)" = "1" ]; do sleep 1 done

Changed your mind? Do the reverse:

On most stock kernels, ZRAM is reinitialized at boot by the init process, so simply removing the disable script will restore it.


zramctl

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.

For devices with 4GB of RAM or less, disabling ZRAM is strongly discouraged as it will lead to frequent application crashes and a significantly degraded user experience. Users implementing this mod should verify the results via /proc/meminfo and monitor system behavior for OOM kills. If you don’t want a persistent module, you

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.


You must set the permissions correctly for the script to execute: To make it permanent without a module, add