Using Magisk is the safest and most efficient method to turn off zRAM. It modifies the system systemlessly without touching the /vendor or /system partitions directly. 🛠️ Methods to Disable zRAM via Magisk 1. Flash a Ready-Made Magisk Module
Create a text file named module.prop and insert the following parameters:
Select Install from storage and choose the downloaded .zip file. Step 5: Once flashed, tap Reboot to apply changes. 2. Create Your Own Custom Magisk Module
If a pre-compiled module does not disable zRAM on your device's specific kernel, you can build a light, custom boot script using Magisk's service.sh functionality. Step A: Structure Your Module Create a folder structure on your PC or device storage:
#!/system/bin/sh # Wait for the system boot to fully complete sleep 30 # Turn off the active zRAM swap device if [ -e /dev/block/zram0 ]; then swapoff /dev/block/zram0 # Reset disksize to release the memory allocated to zRAM echo 1 > /sys/block/zram0/reset fi # Apply to secondary zRAM partitions if present for i in 1 2 3; do if [ -e /dev/block/zram$i ]; then swapoff /dev/block/zram$i echo 1 > /sys/block/zram$i/reset fi done # Set swappiness to 0 to instruct the kernel not to swap echo 0 > /proc/sys/vm/swappiness Use code with caution. Step D: Zip and Flash
Using Magisk is the safest and most efficient method to turn off zRAM. It modifies the system systemlessly without touching the /vendor or /system partitions directly. 🛠️ Methods to Disable zRAM via Magisk 1. Flash a Ready-Made Magisk Module
Create a text file named module.prop and insert the following parameters:
Select Install from storage and choose the downloaded .zip file. Step 5: Once flashed, tap Reboot to apply changes. 2. Create Your Own Custom Magisk Module
If a pre-compiled module does not disable zRAM on your device's specific kernel, you can build a light, custom boot script using Magisk's service.sh functionality. Step A: Structure Your Module Create a folder structure on your PC or device storage:
#!/system/bin/sh # Wait for the system boot to fully complete sleep 30 # Turn off the active zRAM swap device if [ -e /dev/block/zram0 ]; then swapoff /dev/block/zram0 # Reset disksize to release the memory allocated to zRAM echo 1 > /sys/block/zram0/reset fi # Apply to secondary zRAM partitions if present for i in 1 2 3; do if [ -e /dev/block/zram$i ]; then swapoff /dev/block/zram$i echo 1 > /sys/block/zram$i/reset fi done # Set swappiness to 0 to instruct the kernel not to swap echo 0 > /proc/sys/vm/swappiness Use code with caution. Step D: Zip and Flash