Disable Zram Magisk ✰


If you want, I can generate a ready-to-install Magisk module zip you can download (I will provide the file structure and scripts).


After boot:

su
cat /proc/swaps
# Should show no zram entries

free -h

After disabling ZRAM, your device will rely solely on physical RAM. To prevent the Out-Of-Memory (OOM) killer from murdering every background app, adjust the vm.swappiness parameter. disable zram magisk

By default, Android sets swappiness to 100–180 (aggressive swapping). With ZRAM gone, set it to 0 (swap never used) or 10 (very rare swapping if a swap file exists).

Run:

su
echo 0 > /proc/sys/vm/swappiness

To make it permanent, add this line to your service.sh script from Method 2. If you want, I can generate a ready-to-install


Run in terminal as su:

cat /proc/swaps

Expected output (if disabled):

Filename                                Type            Size    Used    Priority

(no /dev/block/zram0 line)

After applying any method, confirm that ZRAM is truly off:

Inside the disable_zram folder, create a text file named module.prop. Paste the following content into it:

id=disable_zram
name=Disable ZRAM
version=v1.0
versionCode=1
author=YourName
description=Disables ZRAM swap to free up CPU cycles.

| 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 | After boot: su cat /proc/swaps # Should show