Skip to content

ferrdishx/LMK-Controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LMK Controller Logo

LMK Controller

Full control over Android's Low Memory Killer — clean WebUI, automatic boot persistence.


What is LMK?

The Low Memory Killer is a kernel mechanism that frees RAM by terminating background apps based on six memory thresholds (minfree). Most OEMs configure these conservatively — causing unnecessary app reloads, poor multitasking and lag when switching between apps.

LMK Controller lets you tune these values through a visual interface and ensures your configuration survives every reboot automatically.


Modes

Mode minfree (pages) Best for
Performance 0, 0, 0, 0, 0, 0 Gaming — max RAM for the foreground app
🌿 Stability 1024, 2048, 4096, 8192, 12288, 16384 Daily use — balanced multitasking
🔵 Default 4096, 5120, 6144, 7168, 8192, 9216 Near-stock — restores AOSP-like behaviour

1 page ≈ 4KB  →  1024 pages = 4MB


Features

  • 🌐 Clean WebUI accessible via MMRL
  • 🔁 Settings persist across every reboot
  • 📜 Boot log for easy diagnostics
  • 🧹 Clean uninstall — removes boot service automatically
  • ⚠️ Compatibility check during installation

Requirements

  • Android 8.0+
  • Magisk 20.4+ or KernelSU
  • MMRL or compatible module manager
  • Kernel with classic LMK node: /sys/module/lowmemorykiller/parameters/minfree

⚠️ Devices running LMKD (userspace LMK, common on Android 10+ with newer kernels) are not supported.

How to check if your device is compatible

Open Termux and run:

# If this file exists → classic LMK → ✅ supported
ls /sys/module/lowmemorykiller/parameters/minfree

# If this returns "true" → LMKD → ❌ not supported
getprop ro.lmk.use_minfree_levels

The module detects this automatically during installation and warns you.


Installation

  1. Download the latest .zip from Releases
  2. Flash via MMRL, Magisk or KernelSU
  3. Reboot

The boot service is automatically installed at /data/adb/service.d/lmk_controller.sh. No manual steps required.


Usage

  1. Open MMRL → navigate to LMK Controller
  2. Select your preferred mode
  3. Tap Apply Settings

Your choice is saved and reapplied automatically on every boot.


Verifying

After rebooting, open Termux and run:

# Boot log — confirms the script ran and what it applied
cat /data/adb/modules/lmk_controller_feerd/boot.log

# Current minfree values
cat /sys/module/lowmemorykiller/parameters/minfree

# Saved mode
cat /data/adb/modules/lmk_controller_feerd/lmk_mode

Expected output:

--- Boot Sat Apr  4 17:00:43 -03 2026 ---
Boot completed, applying...
Mode: gamer
Done: 0,0,0,0,0,0

How boot persistence works

Instead of relying on service.sh (which some Magisk versions skip), the module installs a dedicated script into /data/adb/service.d/ — a directory Magisk always executes on boot, regardless of module state.

On boot the script:

  1. Waits for sys.boot_completed = 1
  2. Applies a short delay to let the system set its own defaults first
  3. Overwrites minfree with your saved values

When the module is uninstalled, uninstall.sh cleans up the script from service.d automatically.


Troubleshooting

Values revert after reboot

cat /data/adb/modules/lmk_controller_feerd/boot.log

If it shows LMK path not found — your kernel uses LMKD and is not supported.

Boot log not generated

ls -la /data/adb/service.d/lmk_controller.sh

If the file is missing, reinstall the module.

WebUI shows wrong mode after reboot The UI resets visually on load — this is cosmetic only. The actual minfree values in the kernel are correct.


Project structure

LMK-Controller/
├── module.prop
├── install.sh        ← installs boot service during flashing
├── uninstall.sh      ← removes boot service on uninstall
├── lmk_boot.sh       ← copied to /data/adb/service.d/ on install
└── webroot/
    └── index.html    ← WebUI

Changelog

  • Initial release
  • Performance, Stability and Default modes
  • WebUI via MMRL
  • Boot persistence via service.d
  • Boot logging

Made by feerd  ·  Download  ·  MIT License

About

Magisk module to control Android's Low Memory Killer. Three modes (Performance, Stability, Default) with a clean WebUI via MMRL and automatic boot persistence.

Topics

Resources

License

Stars

Watchers

Forks

Packages