The following is a
fix for the
known bug - sysctl.conf tweaks not being applied.
1) In /etc/install-recovery.sh, underneath #!/system/bin/sh, add:
Code:
busybox sysctl -p /etc/sysctl.conf
this cause the tweaks to be executed at boot, and therefore persistent through reboot
2) In /etc/sysctl.conf, change your code to look like this:
Code:
vm.swappiness = 0
vm.min_free_kbytes = 2048
vm.dirty_ratio = 95
vm.dirty_background_ratio = 60
vm.oom_kill_allocating_task=1
3) Reboot, then go to terminal emulator or adb and type
cat /proc/sys/vm/dirty_ratio. If you get a value of 95, you were successful.
I quickly fixed this up yesterday when it was pointed out that the tweaks weren't active, but decided to test the tweaks for a while to give you guys some better feedback.
You'll notice that i removed
vm.vfs_cache_pressure=12. The parameter affect's the kernel's tendency to reclaim dentries and inodes, and lowering it favors retaining over reclaiming. By removing it, the parameter defaults to 100. I prefer to keep it at 100, because I noticed that the value of 12 caused my phone to be much snappier at boot and in the first few hours, but as time went by it got slower and slower. By hour 8 it was turtling so hard that I had to reboot just to get back to homescreen.
You'll also noticed that I added
vm.oom_kill_allocating_task=1. This changes the parameter to 1 from the default of 0. With a value of 0, if your phone detects that an app is using too much memory, it will go down your list of running apps and terminate some of them to free up memory. With a value of 1, your phone will terminate the app that is using too much memory instead. I prefer a value of 1, this way memory leaks are dealt with swiftly.
I can also confirm an increase in battery life, with no sacrifice to speed.