yashsingh1/xdaforums huggingface dataset:
[Droid Incredible Android Development] mrQQ:
why does 10sysctl in the zip have

#!/system/bin/sh

# grep sysctl /etc/init.d/*

/etc/init.d/02vm:# Load /sys/etc/sysctl.conf

/etc/init.d/02vm:sysctl -p

instead of

#!/system/bin/sh

# grep sysctl /etc/init.d/*

# Load /sys/etc/sysctl.conf

sysctl -p

?
[Droid Incredible Android Development] EShow:
Not sure. I'm going to try just flashing the zip and hopefully the battery life will be drastic enough for me to know if it's working or not.

I'll report back here with my findings.
[Droid Incredible Android Development] prototype7:
AOKP milestone 5, with aeroevan's v9 kernel. Does this mean that all the other listed values are working and I'm good? Sorry if I sound like I have no idea what I'm doing, because I don't lol.
[Droid Incredible Android Development] pmsrefugee:
Check out my post at rootzwiki under the aokp team and inc with the instructions on how to get it working on milestone 5 using those steps. It might be hard to find so here's the link. If I shouldn't have posted the link I'm sorry and please delete link. But it it pretty hard to find. It's on page 22.

http://rootzwiki.com/index.php?/topic/17878-AOKP-|-inc-|-April-28-|-Milestone-5-|-4.0.4#entry662707

AOKP | inc | April 28 | Milestone 5 | 4.0.4
[Droid Incredible Android Development] :
It can't.

There is nothing in there which would increase battery life. You are about as likely to increase battery life by stroking your phone and making a wish. :rolleyes:

XDA still doesn't disappoint me with it's random placebo posts. :D
[Droid Incredible Android Development] Hero:
Why don't you try it first before posting?

This line in particular "vm.vfs_cache_pressure=10" is important because we want the kernel to favor retaining the file system cache as opposed to trying to reclaim it. In essence, a low vfs_cache_pressure slows things down, saving battery life. This works in conjunction with your ROM's swappiness level (which should be 1,0, or close to 0) so that the Linux kernel no longer attempts to enlarge the cache by paging applications out (keeping the system fast).
[Droid Incredible Android Development] jayallen1980:
Just installed 2 hours ago battery was at 85 percent and now at 77 percent. Phone was not being used.Must be doing something wrong. Got all the errors everyone else get. Gonna charge to 100 percent and wipe battery stats and see if that helps. I am on cm7 7.1.0.
[Droid Incredible Android Development] Keland44:
just installed popped in a new 3500 battery at 100% and cleared battery status
[Droid Incredible Android Development] prototype7:
Well, I tried that, but I had already done the method in the OP, so I didn't know what the permissions were on the old sysctl.conf. I set them to rwx in all three, and used notepad+ to save it as a unix file. I enabled startup tweaks and sysctl.conf in ROM Control, then restarted, but the values in the sysctl config app weren't what they should be. When I use the terminal emulator and put in su then sysctl -p, I get a short write error. I might just end up putting all the values in Sysctl Config manually lol.

P. S. You were right about that post being hard to find. I had to look up your profile and find it from there because that url just brought me to the first post in that thread.
[Droid Incredible Android Development] That Baker Guy:
about to try the flashable zip on cm7.2 RC-1, too lazy to try the manual mod for now, will report back with results, on a side note, is performance affected? havent seen any complaints in the thread so far.

EDIT: flashed, at 71% while plugged in, unplugged, rebooted it said 100% now its dropped to 83, and falling, ill wait till it gets low, after the midnight premier of avengers, then charge over night. test tomorrow.
[Droid Incredible Android Development] Hero:
Performance should either stay the same or improve.
[Droid Incredible Android Development] mustafa.aziz:
Hi Pure Motive

what do you have to say about the errors we are getting;

fs.nr_open = 1053696 fs.inotify.max_queued_events = 32000

fs.inotify.max_user_instances = 256 fs.inotify.max_user_watches = 10240

fs.lease-break-time = 10

fs.file-max = 165164

kernel.threads-max = 525810

kernel.random.write_wakeup_threshold = 256

kernel.random.read_wakeup_threshold = 128

sysctl: error: 'kernel.sched_compat_yield' is an unknown key

kernel.panic = 0

kernel.panic_on_oops = 1

sysctl: error: 'kernel.msgmni' is an unknown key

sysctl: error: 'kernel.msgmax' is an unknown key

sysctl: error: 'kernel.shmmni' is an unknown key

sysctl: error: 'kernel.shmall' is an unknown key

sysctl: error: 'kernel.shmmax' is an unknown key

sysctl: error: 'kernel.sem' is an unknown key

sysctl: error: 'kernel.sched_features' is an unknown key

sysctl: error: 'kernel.hung_task_timeout_secs' is an unknown key

sysctl: error: 'kernel.sched_latency_ns' is an unknown key

sysctl: error: 'kernel.sched_min_granularity_ns' is an unknown key

sysctl: error: 'kernel.sched_wakeup_granularity_ns' is an unknown key

sysctl: error: 'kernel.sched_shares_ratelimit' is an unknown key

kernel.sched_child_runs_first = 0

fs.lease-break-time = 10

fs.file-max = 65536

vm.dirty_ratio = 90

vm.dirty_background_ratio = 80

vm.oom_kill_allocating_task = 1

vm.overcommit_memory = 1

vm.page-cluster = 3

vm.drop_caches = 3

vm.min_free_kbytes = 4096

vm.panic_on_oom = 0

vm.dirty_expire_centisecs = 1000

vm.dirty_writeback_centisecs = 2000

vm.oom_kill_allocating_task = 0

vm.vfs_cache_pressure = 10

vm.min_free_order_shift = 4

vm.laptop_mode = 0

vm.block_dump = 0
[Droid Incredible Android Development] fictionworld:
fs.nr_open = 1053696
fs.inotify.max_queued_events = 32000
fs.inotify.max_user_instances = 256
fs.inotify.max_user_watches = 10240
fs.lease-break-time = 10
fs.file-max = 165164
kernel.threads-max = 525810
kernel.random.write_wakeup_threshold = 256
kernel.random.read_wakeup_threshold = 128
kernel.panic = 5
kernel.panic = 0
kernel.panic_on_oops = 1
kernel.hung_task_timeout_secs = 30
kernel.sched_latency_ns = 18000000
kernel.sched_min_granularity_ns = 1500000
kernel.sched_wakeup_granularity_ns = 3000000
kernel.sched_child_runs_first = 0
fs.lease-break-time = 10
fs.file-max = 65536
vm.dirty_ratio = 90
vm.dirty_background_ratio = 80
vm.oom_kill_allocating_task = 1
vm.overcommit_memory = 1
vm.page-cluster = 3
vm.drop_caches = 3
vm.min_free_kbytes = 4096
vm.panic_on_oom = 0
vm.dirty_expire_centisecs = 1000
vm.dirty_writeback_centisecs = 2000
vm.oom_kill_allocating_task = 0
vm.vfs_cache_pressure = 10
vm.min_free_order_shift = 4
vm.laptop_mode = 0
vm.block_dump = 0
sysctl: error: 'kernel.sched_compat_yield' is an unknown key
sysctl: error: 'kernel.msgmni' is an unknown key
sysctl: error: 'kernel.msgmax' is an unknown key
sysctl: error: 'kernel.shmmni' is an unknown key
sysctl: error: 'kernel.shmall' is an unknown key
sysctl: error: 'kernel.shmmax' is an unknown key
sysctl: error: 'kernel.sem' is an unknown key
sysctl: error: 'kernel.sched_features' is an unknown key
sysctl: error: 'kernel.sched_shares_ratelimit' is an unknown key

NOOB QUESTION, is this already working on my phone with outputs like that?
[Droid Incredible Android Development] mustafa.aziz:
Yes it is working but with some errors which we all are getting and OP is not helping us at all. lets wait and hope for God's help :)

---------- Post added at 12:15 PM ---------- Previous post was at 12:14 PM ----------
[Droid Incredible Android Development] fictionworld:
let's just wait til he notices this topic's on fire again. thank you for the quick response
[Droid Incredible Android Development] Hero:
I do have other things to do other than watch the thread all day...

These errors are stemming from the fact that your kernel probably has no default value for these kernel issues you are getting. So, you can either try a different kernel that DOES support the kernel mods you are getting errors for or just disregard the errors completely. In any case, this mod is not dependent on the kernel mods which you are receiving errors. That being said, whatever mods that will stick, will stick. The others that don't, shouldn't matter. The important thing is that you should be experiencing better battery life.
[Droid Incredible Android Development] fictionworld:
ok. thank you for noticing our heed. I want to hear straight from you sir, although we both are facing these errors, we can expect an improvement to battery life yes?
[Droid Incredible Android Development] Hero:
No worries. Yeah you can probably expect an improvement to battery life. The errors you received control the maximum size of the messages sent between processes (Higher number uses more memory) and the amount of shared memory the system can use at any given time.

Speaking practically, it would be best if you could get the benefits of as much of the mod as possible (eliminating the errors), but that's unfortunately not always the case. Though theoretically, the mod should work fine. If it doesn't, then some of the kernel parameters that were giving you errors before may need to stick for the mod to work correctly (hence why the mod "may" not be universal). If this is the case, contact your kernel dev or mod the values that do stick to fit your needs.
[Droid Incredible Android Development] simo6:
one noob question

do i need to manually launch sysctl -p everytime i reboot phone or just the first time?

p.s. tried it on a H7300 and got the same errors as above but will report if the battery life is improved
[Droid Incredible Android Development] Hero:
If you have an init.d file that has sysctl -p in it then you don't need to manually enter the code each time you reboot the phone. Otherwise, yes you do.
[Droid Incredible Android Development] mustafa.aziz:
Hi Puremotive

appreciate your responses. can you plz tell which phone and ROM are you using. I am using sensation xe and will try different kernels and see the response.
[Droid Incredible Android Development] fictionworld:
clearly stated. thank you.
[Droid Incredible Android Development] WhammyDroid:
Can the file in the system/etc folder be modified on the phone without having to reflash the entire ROM? I would like to use Root Explorer to make the necessary modifications.

Can this be done?
[Droid Incredible Android Development] mustafa.aziz:
Yes this can be done, I have done it already.
[Droid Incredible Android Development] Soopafly Incredible:
I would say it's working for me. I'm down to 16% right now, after 1d 9h 22m of moderate use. And I don't believe I was 100% charged to start.

I am running CM9 a5 with the incredikernal-ics-hwa-beta kernal. I started noticing significant gains once I re-installed Setcpu with a couple non-intrusive profiles.

Thanks much PureMotive! You made waiting on the razr maxx price to drop a whole lot more tolerable with this!
[Droid Incredible Android Development] losta:
i just tried the script...ran the command from the terminal and here is what i get, just would like to know if this script is running as it should or not? i read from page one but still not quite sure :D a simple yes or no should be fine for me though. thanks in advance:)
[Droid Incredible Android Development] mustafa.aziz:
For me the mod did nothing, I am still having bad battery time. May be bcz of the few errors I get the script is not working as it should.
[Droid Incredible Android Development] graymonkey44:
I flashed the new ics leak on the Rezound and flashed the S4 team pkmn Rom, flashed the newest zip and I'm getting a lot better battery life.
[Droid Incredible Android Development] tgamble160:
can anyone please tell me if this will work on htc amaze and samsung vibrant(my girls phone)

already on my amaze but can someone please tell me if it will work on my girls samsung galaxy s vibrant?
[Droid Incredible Android Development] pmsrefugee:
Battery dropping on aokp milestone 5 stock kernel. Going to try new kernel.
[Droid Incredible Android Development] :
I just tried it and suffered a seventeen fold decrease in battery life. Please update thread title to reflect this.
[Droid Incredible Android Development] nelms:
any news? which kernel ya gonna try? i did the power saver option in rom control and it helped some.
[Droid Incredible Android Development] Hero:
It's not working. Your output in terminal doesn't match that of the OP. Something you can try is either deleting all of the net tweaks and then rerunning sysctl -p OR deleting the sysctl.conf file from your device and only use init.d. This applies to everyone who is still having issues. Create a new file in init.d and copy/paste the following code (I changed it around a bit)

#!/system/bin/sh
sync
sysctl -w fs.nr_open=1053696
sysctl -w fs.inotify.max_queued_events=32000
sysctl -w fs.inotify.max_user_instances=256
sysctl -w fs.inotify.max_user_watches=10240
sysctl -w fs.lease-break-time=10
sysctl -w fs.file-max=165164
sysctl -w kernel.threads-max=525810
sysctl -w kernel.random.write_wakeup_threshold=256
sysctl -w kernel.random.read_wakeup_threshold=128
sysctl -w kernel.sched_compat_yield=1
sysctl -w kernel.panic=0
sysctl -w kernel.panic_on_oops=1
sysctl -w kernel.msgmni=2048
sysctl -w kernel.msgmax=64000
sysctl -w kernel.shmmni=4096
sysctl -w kernel.shmall=2097152
sysctl -w kernel.shmmax=268435456
sysctl -w kernel.sem=500 512000 64 2048
sysctl -w kernel.sched_features=24189
sysctl -w kernel.hung_task_timeout_secs=30
sysctl -w kernel.sched_latency_ns=18000000
sysctl -w kernel.sched_min_granularity_ns=1500000
sysctl -w kernel.sched_wakeup_granularity_ns=3000000
sysctl -w kernel.sched_shares_ratelimit=256000
sysctl -w kernel.sched_child_runs_first=0
sysctl -w fs.lease-break-time=10
sysctl -w fs.file-max=65536
sysctl -w vm.dirty_ratio=90
sysctl -w vm.dirty_background_ratio=80
sysctl -w vm.oom_kill_allocating_task=1
sysctl -w vm.overcommit_memory=1
sysctl -w vm.page-cluster=3
sysctl -w vm.drop_caches=3
sysctl -w vm.min_free_kbytes=4096
sysctl -w vm.panic_on_oom=0
sysctl -w vm.dirty_expire_centisecs=1000
sysctl -w vm.dirty_writeback_centisecs=2000
sysctl -w vm.oom_kill_allocating_task=0
sysctl -w vm.vfs_cache_pressure=10
sysctl -w vm.min_free_order_shift=4
sysctl -w vm.laptop_mode=0
sysctl -w vm.block_dump=0
[Droid Incredible Android Development] nattygirl:
Same here using CM9
[Droid Incredible Android Development] starkilling:
Hey guys, I ran sysctl -p, here's my output:

Desire HD on IceColdSandwich 7.4
[Droid Incredible Android Development] Hero:
Aside from the errors (kernel issues) the mod is working :) Let me know if you experience an increase in battery life.
[Droid Incredible Android Development] starkilling:
Thanks, I'll report back in a day or so.
[Droid Incredible Android Development] kentoe:
Noticing some of the changes that you're implementing in this mod, how much is this affecting the performance? I'm already on the edge of performance with CM9a6 w/ incredikernel hwa 1 and am wanting to implement this into my phone but I can't see taking anymore performance hits than I already would be with CM9.
[Droid Incredible Android Development] Shano56:
theres only one way to find out ;)
[Droid Incredible Android Development] :
I don't need to try it. I'm confident that I am knowledgeable enough about the linux kernel and Android in general to know that nothing here could affect battery life and that the majority of your tweaks will hurt performance and interactivity.

Swappiness is to do with how likely the vm is to swap pages out to disk, whether it be for cache, data, etc. Without a swap file / partition, the swappiness value does *absolutely* nothing. I have come across that misconception many times here on XDA, and it still makes me chuckle.

Also, have you considered the fact that Android, by design, preloads applications into memory speculatively? And, of course, users use their devices and load apps which stay persistent in RAM. Once it starts doing that, the cache will be reclaimed as the memory usage by Android applications increases forcing cache to be reclaimed and the only method of stopping that is to set it to 0 which would be very bad and would likely result in out of memory issues.

The simple fact is, if RAM is required and there is no swap space available, cache will be reclaimed, regardless of the vfs_cache_pressure value, so there is no point setting that value low as if there isn't any free RAM (due to preloading or user activity) cache *will* be reclaimed.

With all due respect, your tweaks can't possibly affect battery life and certainly will *not* increase performance. The defaults are sane and *do* work.

The only way of increasing battery life on a device is to make the applications processor and the modem processor to go into suspend quicker and stay there for longer, so reduce wakelocks, wakeup interrupts, etc. None of these tweaks will do that.
[Droid Incredible Android Development] tgamble160:
working awesome on my amaze! heavy use for almost 3 hours battery still at 94% with a phone call that lasted 54 minutes on bluetooth and then streaming video. unbelievable! and the vibrant seems good to she talks nonstop been on it for over 2 hours and battery went from 78% to 67 %
[Droid Incredible Android Development] ferotakis:
Nice touch dude ;)
[Droid Incredible Android Development] zamula:
I attempted this on my HTC Inspire running Ice Cold Sandwich 7.4. The result was terrible, with lockups and a noticeable sluggishness in about every app. Needless to say I had to revert to the default.

It was worth a try a least...
[Droid Incredible Android Development] Hero:
What kernel are you running? Stock? Also, did you check the values in the terminal to make sure they were sticking and that they were the culprit?
[Droid Incredible Android Development] zamula:
I'm running 9.6.1 CFS. And I did check the values in the terminal and they stuck except for the few with errors.

Considering the slow-downs were so noticeable I'm really not up for experimenting too much, unless someone else has tried the script (or modified version) on the same ICS build and kernel.

And it was definitely the script that caused the issues, because once I reverted to the original, everything worked normally again.
[Droid Incredible Android Development] distortedloop:
A well reasoned and presented post.

I also wondered how a few memory tweaks could give these miraculous battery results so many are claiming. Is it really placebo affect?

I figure Google's android software engineers are fairly sharp; seems like if it were this ready to increase battery life tenfold they would have figured it out.

Would be sweet if it were this simple.

I guess it's like the urban legends that batterystats.bin wipes improve battery. Many still think it's so despite a google engineer publicly starting it's just not so.

Thanks for that post.
[Droid Incredible Android Development] Hero:
Check to see if the kernel has zram. If it does, you can try adding a zram swap (so changing the swappiness value does work) ...only if you want to try the mod again.

Is it a placebo? Try it and find out. Pikachu01's mod uses similar memory tweaks, and his mod achieves better battery life as well... maybe you should look into it. The major differences is that his addresses CPU governors and I/O schedulers, which this does not. But then again, you can always add those yourself. In his mod, the VM is scaled depending on the screen state to save battery, but this one simply just scales the value for all states.
[Droid Incredible Android Development] TokedUp:
I can't confirm it but my battery does seem to be better a day after flashing the zip. My battery gauge hasn't moved all day and I've been using my phone pretty heavily.
[Droid Incredible Android Development] letters_to_cleo:
can this work on a unrooted latest STOCK GB?
[Droid Incredible Android Development] mushat3k:
Running evervolv 2.2.0a2 with incredikernel beta 1, this mod certainly appears to be holding up. I have noticed significant increase in battery life, thanks for the work on this pure, you're one hell of a dev. Any chance you are going to move onto the Inc 4g? No need for the bashing in this thread for the people who say it doesn't work but won't flash it to see, I'm used to pretty terrible battery life and this mod does as it says. Maybe not ten fold, but its at least double, which makes a huge difference
[Droid Incredible Android Development] jayallen1980:
Not working for me on cm7 7.1.0. Well I tried maybe its not meant for cm7 who knows. Thanks anyways
[Droid Incredible Android Development] Hero:
Do you mean that when you check the values they don't stick? Or that the values stick but you don't experience a boost in battery life?
[Droid Incredible Android Development] d08speed3:
In my CM7 everyhting sticks but I don't see any boost in battery life
[Droid Incredible Android Development] That Baker Guy:
yeah, the flashable zip doesnt work for me on cm7.2 ill perform a wipe and reflash of cm7.2 then try the manual method.
[Droid Incredible Android Development] cmlusco:
These IMHO are the best settings you can use.

Sysctl.conf

# Sysctl configuration file
vm.dirty_ratio = 90
vm.dirty_background_ratio = 0
vm.vfs_cache_pressure = 5
vm.oom_kill_allocating_task = 1
vm.min_free_kbytes = 4096
#
vm.panic_on_oom = 0
vm.oom_dump_tasks = 1
vm.overcommit_ratio = 50
vm.page-cluster = 3
vm.dirty_background_bytes = 0
vm.dirty_bytes = 0
vm.dirty_writeback_centisecs = 500
vm.dirty_expire_centisecs = 200
vm.swappiness = 0
vm.lowmem_reserve_ratio = 32
vm.drop_caches = 0
vm.min_free_order_shift = 4
vm.max_map_count = 65530
vm.laptop_mode = 0
vm.block_dump = 0
vm.mmap_min_addr = 32768
fs.overflowgid = 65534
fs.leases-enable = 1
fs.lease-break-time = 45
fs.aio-max-nr = 65536
fs.inotify.max_user_instances = 128
fs.inotify.max_user_watches = 8192
fs.inotify.max_queued_events = 16384
fs.epoll.max_user_watches = 45738
fs.suid_dumpable = 0
net.ipv4.tcp_congestion_control = cubic
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_mem = 65536 131072 262144
net.ipv4.udp_mem = 65536 131072 262144
net.ipv4.udp_rmem_min = 16384
net.core.rmem_default = 131072
net.core.rmem_max = 16777216
net.ipv4.udp_wmem_min = 16384
net.core.wmem_default = 131072
net.core.wmem_max = 16777216
net.core.somaxconn = 32768
net.core.netdev_max_backlog = 4096
net.core.dev_weight = 64
net.core.optmem_max = 65536
net.ipv4.tcp_max_tw_buckets = 1440000
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_max_orphans = 16384
net.ipv4.tcp_orphan_retries = 0
net.ipv4.ipfrag_high_thresh = 512000
net.ipv4.ipfrag_low_thresh = 446464
net.ipv4.tcp_no_metrics_save = 1
net.ipv4.tcp_moderate_rcvbuf = 1
net.unix.max_dgram_qlen = 50
net.ipv4.neigh.default.gc_thresh3 = 2048
net.ipv4.neigh.default.gc_thresh2 = 1024
net.ipv4.neigh.default.gc_thresh1 = 32
net.ipv4.neigh.default.gc_interval = 30
net.ipv4.neigh.default.proxy_qlen = 96
net.ipv4.neigh.default.unres_qlen = 6
net.ipv4.tcp_ecn = 1
net.ipv4.tcp_reordering = 3
net.ipv4.tcp_retries2 = 15
net.ipv4.tcp_retries1 = 3
net.ipv4.route.flush = 1
net.ipv6.route.flush = 1
[Droid Incredible Android Development] losta:
thank you so much, im gonna give it a try :)

edit : a few more questions :) after i make the new file in init.d, what command should i type from the terminal to know if the script is running as it should? i'm trying the second option you given me, using only the init.d and i deleted the sysctl.conf. many thanks before
[Droid Incredible Android Development] AeonWorld:
yeah that's right, it drains no matter what when display is on and radio is on, but there where issues regarding battery drain even in airplane mode that's why I shared. of course no use when running