Android Developer

How To Enable More Background Apps

Magisk Required

0 524

Tweak the memory management of the device, enable more background apps.. et cetera..


Virtual memory tweaks

stop perfd
echo '30' > /proc/sys/vm/swappiness
echo '0' > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk
echo '80' > /proc/sys/vm/overcommit_ratio
echo '400' > /proc/sys/vm/vfs_cache_pressure
echo '24300' > /proc/sys/vm/extra_free_kbytes
echo '128' > /proc/sys/kernel/random/read_wakeup_threshold
echo '256' > /proc/sys/kernel/random/write_wakeup_threshold
echo '1024' > /sys/block/mmcblk0/queue/read_ahead_kb
echo '0' > /sys/block/mmcblk0/queue/iostats
echo '1' > /sys/block/mmcblk0/queue/add_random
echo '1024' > /sys/block/mmcblk1/queue/read_ahead_kb
echo '0' > /sys/block/mmcblk1/queue/iostats
echo '1' > /sys/block/mmcblk1/queue/add_random
echo '4096' > /proc/sys/vm/min_free_kbytes
echo '0' > /proc/sys/vm/oom_kill_allocating_task
echo '90' > /proc/sys/vm/dirty_ratio
echo '70' > /proc/sys/vm/dirty_background_ratio
chmod 666 /sys/module/lowmemorykiller/parameters/minfree
chown root /sys/module/lowmemorykiller/parameters/minfree
echo '21816,29088,36360,43632,50904,65448' > /sys/module/lowmemorykiller/parameters/minfree

Some tweaks are there only to have a positive effect when another feature will be activated like agressive LMK is disabled but LMS scaling has been set or vm.swappiness set to 30 but no swap/zRAM by default.

These can be easily set via other tools or apps that support init.d scripts and build.prop editing but I use Magisk anyway.. so.. why not using it to do the job, properly – with successful SafetyNet test ( :

These changes are basic/fundamental changes in the behavior of Android system (ActivityManager, etc.) and the Linux kernel (LMK) – thus works on almost anything starting from Android 4+ as far as I can tell you. The only bottleneck is the RAM: I recommend at least 2GB or RAM, it has been tested on 3GB and 4GB with AEX 4.6 and ElectraBlue kernel and MIUI EU Dev ROM.

Here is a video from a testuser that shows how efficient is the multitasking with the module (no tab reloading in Chrome, no reloading of apps – even though the testuser is using 20+ apps).

NOTE: If you are using MIUI ROM please disable MIUI optimization and MIUI memory optimization because it resets most of these settings. If you use any app that tweaks settings above please uninstall or at least disable them to run and ruin the module’s settings.

How to install it :

  1. First thing first, you must install Magisk, doesn’t know how to install it?. Go here
  2. After succeed installing magisk, you need to download this module, and save it to internal storage
  3. Now, it’s time to install the module. You can install it via twrp or via magiskmanager
Via Magisk
  1. Open your magiskmanager
  2. Then, tap on modules section
  3. Tap on yellow plus button
  4. Choose the module that you’ve download
  1. Reboot into recovery by holding vol up + power
  2. Then, press ‘install’
  3. Choose the module that you’ve download
  4. Reboot
Source github

be first getting something new
in your inbox

Subscribe to our mailing list to help me making this blog stay alive.

Thank you for subscribing.

Something went wrong.

%d bloggers like this: