rompelhd

Swap-Disabler

v1.0.0guide

A module designed to disable swap at system startup. Is particularly beneficial for devices equipped with a substantial amount of RAM, where the use of swap is unnecessary and may even hinder performance.

★24 stars
•Performance & Kernel•by rompelhd•Proprietary•Updated Jan 18, 2025
Platforms:
✓ Magisk

Overview

Many smartphone manufacturers aggressively market “Virtual RAM,” “RAM Plus,” or “Dynamic RAM Expansion,” which allocate several gigabytes of internal flash storage as a secondary swap partition. On older devices with 2GB–3GB of physical RAM, swap can prevent out-of-memory crashes. However, on modern smartphones equipped with 8GB, 12GB, 16GB, or more of high-speed LPDDR physical RAM, swap is not only redundant—it actively hinders performance.

Because flash storage operates orders of magnitude slower than physical RAM, paging memory back and forth induces I/O latency, micro-stutters during app switching, and accelerates wear on the device’s internal flash storage chips.

Developed by rompelhd, Swap-Disabler is a systemless Magisk module that automatically executes swapoff commands during startup, permanently disabling active disk swap files and virtual RAM mechanisms.

Advantages of Disabling Swap on High-RAM Devices

  1. Eliminates Storage Wear: Prevents hundreds of gigabytes of unnecessary background write operations to internal UFS flash over months of daily use.
  2. Smoother App Switching: Applications kept in fast physical RAM wake up instantly without waiting for compressed flash pages to swap in.
  3. Reduces CPU Workload: Eliminates the CPU cycles the kernel spends calculating compression algorithms and managing swap tables.

Installation & Verification

  1. Verify that your device has at least 8 GB of physical RAM.
  2. Download the latest Swap-Disabler-v*.zip archive from GitHub releases.
  3. Flash the package in Magisk.
  4. Reboot your device.
  5. In Termux or an ADB shell, verify that swap has been disabled:
    su -c free -m
    (The Swap row should report 0 total and 0 used).