He had root. He had Magisk. He had a plan.
Place the script in one of these directories (create them if they don’t exist):
Compressing data requires CPU cycles. Disabling it frees up the CPU, potentially leading to a snappier interface and better battery life.
Open your root file manager and grant it superuser permissions. Navigate to the following directory: /data/adb/service.d/
Before proceeding, ensure your device meets the following requirements to prevent system instability: disable zram magisk
If you change your mind, re-enabling ZRAM is straightforward.
When the system quickly needs to fetch an app from zRAM, the CPU must pause to decompress it, leading to noticeable frame drops.
The extra CPU work required for compression and decompression translates directly to additional power draw. While the impact may be marginal on efficient modern SoCs, every extra CPU cycle contributes to battery drain over the course of a full day's usage. For users who prioritize battery life above all else, disabling zRAM can yield a small but measurable benefit.
: After setting the correct permissions (rwxr-xr-x) and rebooting, Alex opened a terminal app and typed free . The "Swap" line finally read 0 , meaning zRAM was officially banished. The Happy Ending He had root
to the reset file to collapse the compressed partition. This ensures the change persists across reboots without permanently altering the factory firmware. Conclusion
Remove the custom module directory:
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):
While Android utilizes zRAM to compress memory pages and virtually expand available RAM, high-end devices with 8GB, 12, or 16GB of physical RAM often perform smoother without the CPU cycles wasted on constant compression and decompression. Place the script in one of these directories
Request root privileges by typing the following command and pressing enter: su Use code with caution.
If you ever experience instability or want to revert your changes, simply open the Magisk app, remove the custom module (or delete the script from /data/adb/service.d/ ), and reboot your phone to restore stock zRAM behavior. If you want to fine-tune your device further, let me know: Your device's The Android version you are currently running Whether you are using a stock or custom kernel Share public link
Since Android system partitions are read-only, you cannot simply delete the swap file. The best method to disable ZRAM permanently is using a . This ensures the change survives reboots and is systemless (it does not modify the actual system partition).
su swapoff /dev/block/zram0 echo 0 > /sys/block/zram0/disksize