Place the script in one of these directories (create them if they don’t exist):
In demanding mobile games, the sudden compression of background memory can cause frame drops. Removing zRAM ensures consistent frame delivery.
Inside that folder, create a file named service.sh .
If the output returns blank, or if /dev/block/zram0 is missing from the list, zRAM has been successfully disabled . If you see an active partition with size values listed, the script did not execute correctly. Alternatively, you can run: free -m Use code with caution. disable zram magisk
ls -l /sys/block/zram*
Simply remove the module from Magisk Manager and reboot. ZRAM will be reinitialized by the kernel/init scripts automatically.
If your device has 8GB, 12GB, or more physical RAM, your system rarely needs to compress memory. Disabling zRAM ensures your CPU spends zero cycles on memory management, giving you raw, uncompressed performance. Prerequisites Before You Begin Place the script in one of these directories
The primary risk is an scenario. If your system runs out of physical RAM and has no swap space (zRAM) to fall back on, it will begin aggressively killing background processes or may even soft-reboot. If your device enters a bootloop or becomes unstable:
Magisk is the preferred tool for this modification because it operates . Traditionally, changing kernel parameters required modifying the /system partition, which breaks Android's "SafetyNet" and prevents OTA updates. Magisk allows users to inject scripts during the boot process that alter kernel parameters (via resetprop or sysfs writes) without touching the actual system files. The Performance Argument
However, some advanced users choose to for specific reasons: If the output returns blank, or if /dev/block/zram0
echo 0 > /sys/block/zram0/disksize 2>/dev/null echo 0 > /sys/block/zram1/disksize 2>/dev/null
You must set the permissions correctly for the script to execute:
Open service.sh with a text editor and add the following lines: