9 Dec 2013

Android Battery Saving Tips With Edit sysctl ( tweaking )

This opportunity TRICK and TUTORIAL SMARTPHONE share information about
Android Battery Saving Tips With Edit sysctl ( tweaking ) "

Android wasteful batteries ? Do you think the battery saving tips only a small effect ? This tweak requires sysctl.conf. What does this sysctl.conf ?

Because the Linux -based Android, just like in linux, android is also contained in a file named sysctl.conf containing the kernel parameters. With sysctl Config application in android, we can modify the sysctl.conf file in our handhelds to improve performance and extend battery life. That is, here making the batteries wear out too quickly / wasteful .
In the sysctl settings do not stay after a reboot, so that we can adb remount then create a sysctl.conf file on our PC with these settings, then. / Adb push sysctl.conf / etc / kernel must then apply the settings every reboot.

Keep in mind this tweak will not affect the results of a benchmark such as the quadrant benchmark.
Benchmark more toward the hardware and are not affected by this tweak.
For example, before I modify the sysctl, your android with standard usage, when at 6 am you unplug it from the charger, at 6 pm you when the battery remaining 20 % return. Once modified, at 6 pm you when return 50-60 % battery remaining.
Once again I remind Tweaking unlike Overclocking, OC refers more directly to the hardware while more tweaks to the script that drives the overall performance

HOW I ( easy - medium )
Open Terminal and run this command as root.
Before starting let us know about sysctl.
Sysctl Config is a utility application that are common to the latest custom ROM or you can get it for free on the android market.

What's the point ? The point is to sysctl.conf file tweaking the way to the brain ware (you).

What are the requirements ?
1.Handheld Android ( of course ) already Root
2.Installed Busybox .

Well now we cover per point parameters.
Min Free KBytes ( vm.min_free_kbytes ), is used to create the Virtual Memory ( VM ) Linux maintains the minimum value kilobytes. VM used to calculate values ​​for each zone pages_min low memory in the system. Each zone has low memory in the system value reserve free pages in accordance with its own size. The default value of this point is 2048 ( may vary depending on the device's ).

Dirty Ratio ( vm.dirty_ratio ) and Dirty Background Ratio ( vm.dirty_background_ratio ) function controls how often the kernel writes the data to disk ( disk in this case is the internal sd card in the system / handhelds, not the external sd card ). When applications write data to disk, Linux actually does not write data directly to disk, but writing to the linux kernel handles system memory and when and how the data is inserted into the disc. Sysctl values ​​presented in percentage, the higher the percentage that sampeyan enter, wait longer to enter the data on the disk, on the contrary, the lower the percentage value sampeyan entered, the data is more often incorporated into the disk . Now we remember again, we are dealing with an internal disk is a solid state disk, not the disk with system disk like a hard drive on a computer, so we can hold the system to enter data to disk in the disk longer than the system disk. ( Note why use the term linux ? Because it is basically a android from linux )

VFS Cache Pressure ( vm.vfs_cache_pressure ), This is interesting, the file system cache ( dentry / inode ) is more important than the cache block in the dirty ratio and dirty background ratio, so we want the kernel to use more RAM for cache file system. This will improve the performance of the system without sacrificing performance at the application level. The default value is 100 ( in percentage ), which must be done is to change the lower percentage to notify the kernel that supports the file system cache and not to drop it suddenly.

Oom Allocating Task ( vm.oom_kill_allocating_task ) given in sysctl option is enabled or not tick means or represents the value of 1 " / 0 " or On / Off .
This feature is used to activate or not the trigger for the killing task in situations OOM ( Out Of Memory ). If this is not checked / enabled, OOM Killer will scan the entire list of tasks and select the task that will kill based on heuristics ( please googling it means hehe ). OOM will usually choose a task that takes up a lot of memory ( memory hogging rogue ) which will be a relief when in the kill large amounts of memory. When this point is enabled / checked, then the OOM Killer going to kill applications that trigger OOM condition. It minimizes the scanning task which could result in a system hang or freeze.

The values ​​that you need to enter the sysctl Config ? Depending on the hardware and their own comfort.
The point value please try one by one. With mengaktifan sysctl, let you try the default configuration for 1-2 days, if it is less, please permuted values. This is an example of kernel parameters are used.

Min Free KBytes : 4096
Dirty Ratio : 90
Dirty Background Ratio : 70
VFS Cache Pressure : 1
Oom Allocating Task : On, or the value is 1 ( 0 = not active )
The result was as described above

HOW II ( easy - medium )
You can also use ROM Toolbox
1.Download here and install ROM Toolbox Pro v4.4.4
2.If requested permission from superuser you click " allow "
3.Masuk performance options > Kernel tweaks >

4.Di sysctl conf option you can type the parameters you want

HOW III ( Expert )
For example sysctl.conf you can search on google : here
Open Terminal and run this command as root
Tweak virtual memory to conserve power when running on batteries :
code :
echo 0 > / proc / sys / vm / swappiness # can be ignored if you dont use swap
echo 0 > / proc / sys / vm / dirty_expire_centisecs # can be ignored if you dont use swap
echo 0 > / proc / sys / vm / dirty_writeback_centisecs # can be ignored if you dont use swap
echo 60 > / proc / sys / vm / dirty_background_ratio
echo 95 > / proc / sys / vm / dirty_ratio

Tweak virtual memory when you Charger :
code :
echo 0 > / proc / sys / vm / swappiness # can be ignored if you dont use swap
echo 3000 > / proc / sys / vm / dirty_expire_centisecs # can be ignored if you dont use swap
echo 500 > / proc / sys / vm / dirty_writeback_centisecs # can be ignored if you dont use swap
echo 10 > / proc / sys / vm / dirty_background_ratio
echo 40 > / proc / sys / vm / dirty_ratio

Detecting apps / services that require more performance on battery / cpu :
Here explained that the performance of which requires more battery energy, for that you must stop all applications that are not really roads / standby when you are not using them.
If you want to find apps that are in the standby period, but you do not need, then you can use :
code :
strace - p $ ( pidof yourapp ) # for all your running applications
ps aux | awk ' {print $ 10 , $ 11 } ' | sort - n # will list all running softs sorted by used cpu time

By default when android memory to run the application through the process list android starts killing he thought processes using too much memory. This sysctl makes android kill runaway processes that make the system run out of memory instead, which is usually what you want. ( It also will reduce CPU time and increase battery usage ).
code :
sysctl - w vm.oom_kill_allocating_task = 1

vfs_cache_pressure to 10, providing more input to the fs cache and inode to save cpu At the default value of vfs_cache_pressure = 100 the kernel will attempt to reclaim dentries and inodes at a " fair " with respect to pagecache and swapcache ( save command system temporarily ) back. Decrease vfs_cache_pressure causes the kernel to prefer to retain dentry and inode cache. Increasing vfs_cache_pressure beyond 100 causes the kernel to prefer to reclaim dentries and inode.
code :
sysctl - w vm.vfs_cache_pressure = 10

* Good luck *
Posted by Mochamad Aksan Tudhonni
TRICK and TUTORIAL SMARTPHONE Updated at: 20:08

Popular Posts