This is where —the systemless rooting interface—comes in. Using Magisk, we can disable ZRAM entirely without modifying the system partition. But be warned: Disabling ZRAM on a low-RAM device will cause apps to crash and reload frequently.
In theory, ZRAM is a lifesaver for devices with 2GB–4GB of RAM, allowing more apps to stay open. However, in practice—especially on custom ROMs, gaming-focused setups, or high-RAM devices (8GB+)—ZRAM can cause due to the constant compression/decompression cycle.
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. 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
su cat /proc/swaps You will see output similar to:
Filename Type Size Used Priority /dev/block/zram0 partition 2097152 102400 100 If you see /dev/block/zram0 (or zram1, etc.), ZRAM is active. The Size is in kilobytes (e.g., 2097152 KB = 2GB). This is where —the systemless rooting interface—comes in
Introduction: What is ZRAM and Why Would You Want to Disable It? ZRAM is a feature of the Linux kernel (which powers Android) that creates a compressed block device inside your RAM. When your system runs out of physical memory, it compresses old or less-used pages and stores them in this ZRAM space instead of writing them to the slower internal storage (swap file).
By default, Android sets swappiness to 100–180 (aggressive swapping). With ZRAM gone, set it to (swap never used) or 10 (very rare swapping if a swap file exists). In theory, ZRAM is a lifesaver for devices
Alternatively, check ZRAM size with: