yashsingh1/xdaforums huggingface dataset:
[Droid Incredible Android Development] dAii7:
It actually works!

I must testify. After few tries with the code with no success, I finally got it to work and is working in amazing way. First, I want to thank the OP for sharing this with us, thank you so much, friend. It does work! This the best mod ever made, because of the battery life that you can get! I can't remember feeling like towards a mod; this is the best mod ever developed until now.

My phone has drained only 10% of battery in four hours! I am going for six hours and half in 82%!!! It's day two and is amazing guys! I have posted pictures to prove it. I am running MIUI 2.3.2.

Here's how I did it, I did it the manual way, not the flashing way. First, you're going to open the rom in 7zip and do exactly what OP says, back up your rom, then wipe cache and dalvik cache. Next, flash the updated rom.

The code I used is the second one without the semi-colons. By Tiny

#sysctl.conf file
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.sched_compat_yield=1
kernel.panic=5
kernel.panic_on_oops=1
kernel.msgmni=2048
kernel.msgmax=64000
kernel.shmmni=4096
kernel.shmall=2097152
kernel.shmmax=268435456
kernel.sem=500 512000 64 2048
kernel.sched_features=24189
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_shares_ratelimit=256000
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

Now, the code I used to enable the code was this:

#!/system/bin/sh
sysctl -p /system/etc/

After you have flashed it, do not use terminal, do not do anything in root explorer. It is done, the only thing you need to do is recalibrate your batter, I recommend Battery Calibration app by Nema in the Market. You will know that it has worked after seeing the results

Back then in six hours I would have like 38% left in an extended battery. 1800 mAh.
[Droid Incredible Android Development] AshtonTS:
Confirmed working on CM7.2 idk if that's already been addressed or not but it definitely works here
[Droid Incredible Android Development] McDastardly:
I'll second that. Running the flashed version on RC3.
[Droid Incredible Android Development] capostat:
any word on whether this works with nils sense roms?
[Droid Incredible Android Development] EricS96521:
I'm running nils rom and just installed the zip so I'll see how it does.

Also, how do I know the zip worked after I install it?
[Droid Incredible Android Development] jwds1978:
Battery Monitor Widget Pro is estimating upward of ~23 hours for 100% discharge after making these changes. It will take a week or so until BMW indicates more accurately, but the point is that it's noticing the changes made. I did them a few days ago and have had some better system performance as well as longer battery life. It's not a placebo as I didn't have to use the spare battery that I keep in my pocket; which I usually need to utilize to get me through the day. Also, BMW is also noticing a difference and has always been quite accurate with its estimates. Anyhow, I'm happy with the results at any rate.
[Droid Incredible Android Development] withbloodskies:
Mainly just study the battey life, maybe download the Battery Monitor Pro, or something that shows how much battery life is left.

You should conduct a study before installing the zip or files then do a study after.
[Droid Incredible Android Development] rick311:
Will this work on the CM9 roms that use incredikernel with hwa?
[Droid Incredible Android Development] tiny4579:
Pretty sure it does. There's nothing rom specific and the kernel is more responsible for what tweaks work and ive heard people have success with this mod on both gingertiny and incredikernel.
[Droid Incredible Android Development] stiltzkin:
I can confirm it's working in CM9, at least in drk_hd's zips and my own builds of his source. I've tried it with both Incredikernel HWA and mamarley's kernel - my battery life definitely seems extended by at least a few hours, and I get the correct output from sysctl, indicating it's applied. Fantastic mod.
[Droid Incredible Android Development] rick311:
How can we tell for sure that it took? Just by the battery life? I flashed it, just not sure if its working.
[Droid Incredible Android Development] stiltzkin:
From Terminal Emulator or ADB, do "sysctl -a | grep vm" as root. Your output should look like the following:

vm.overcommit_memory = 1
vm.panic_on_oom = 0
vm.oom_kill_allocating_task = 0
vm.oom_dump_tasks = 1
vm.overcommit_ratio = 50
vm.page-cluster = 3
vm.dirty_background_ratio = 5
vm.dirty_background_bytes = 0
vm.dirty_ratio = 90
vm.dirty_bytes = 0
vm.dirty_writeback_centisecs = 2000
vm.dirty_expire_centisecs = 1000
vm.nr_pdflush_threads = 0
vm.swappiness = 50
vm.lowmem_reserve_ratio = 32
vm.drop_caches = 3
vm.min_free_kbytes = 4096
vm.min_free_order_shift = 4
vm.percpu_pagelist_fraction = 0
vm.max_map_count = 65530
vm.laptop_mode = 0
vm.block_dump = 0
vm.vfs_cache_pressure = 10
vm.mmap_min_addr = 32768
vm.scan_unevictable_pages = 0
sysctl: error reading key 'net.ipv4.route.flush': Permission denied
sysctl: error reading key 'net.ipv6.route.flush': Permission denied

As long as these values are the same as the ones provided by OP, you should be fine. I believe the two errors at the bottom are normal.
[Droid Incredible Android Development] rick311:
i don't think mine worked. this is what i got after flashing the zip:
[Droid Incredible Android Development] stiltzkin:
You should be running that command as root, but yeah, it definitely didn't apply correctly. I didn't have success with the flashing route either - I highly recommend editing the files manually in the ROM .zip before flashing it instead.

If you'd rather not edit files, you can just grab my latest build of drk_hd's source (from this morning) with the mod already conveniently applied. Run that command again and you should get the correct output this time.

EDIT: Here is a newer build, incorporating the MMS fix from earlier today.
[Droid Incredible Android Development] rick311:
How does one run the command as root? And editing the files: do I do that on the computer or through the phone?

As far as your build, is that just like flashing a new rom? Would I need to wipe or anything?
[Droid Incredible Android Development] stiltzkin:
You can edit the files right on your phone, but it's a little easier to just do it on the computer with the .zip file. All you're doing is replacing the contents of /etc/sysctl.conf with the values OP provided (the ones without semicolons) and then creating a file called 10sysctl to initialize it in /etc/init.d. You want to make sure your permissions are correct as well - you can do that with Root Explorer or a similar app. To execute a command as root, just type "su" on the commandline first - you'll probably get a prompt from Superuser - just hit Allow.

You shouldn't need to wipe data before flashing my build, as long as you're already running one of the nightlies (i.e. from this thread). As usual, always good to have backups just in case though! :)
[Droid Incredible Android Development] snow:
I made a special version of this mod for Droid Incredible into bash code (init.d script file). See my attachment. :D I don't have such device, but maybe you will enjoy my effort to bring this great mod for users who face problems. I made in this way for Galaxy Mini, very probably will work for Droid Incredible too. Your ROM have to support init.d feature.

Instructions:

1. Reboot to CWM

2. Wipe Battery Stats

3. Mount /system

3. Flash zip file

If you forgot to mount /system, then make sure you mount it (it's very important) and flash again the file.

Any feedback would be appreciated. :)
[Droid Incredible Android Development] withbloodskies:
I'll try it out, why wip battery though?

Edit: flashed fine.. guess I'll have to wait to see the battery life.

Would this work for stock kernels too?
[Droid Incredible Android Development] rick311:
awesome! thanks man. i flashed it and things look like they're working.
[Droid Incredible Android Development] ferotakis:
What are the perms of this file?
[Droid Incredible Android Development] snow:
The permissions are rwx rwx rwx.

---------- Post added at 09:15 PM ---------- Previous post was at 09:10 PM ----------

You can see if this worked by typing in Terminal such commands:

su

sysctl -a | grep fs

sysctl -a | grep kernel

sysctl -a | grep vm

Compare the values from Terminal with the values from first post of this thread. If the values are the same, the patch worked.

If the kernel has support for init.d, the patch will work. To be more simple: If you see in /system/etc folder "init.d" (and some/many files inside of it), the kernel has support for init.d feature. So probably, for stock kernels/original firmwares (without modifications) will not work.
[Droid Incredible Android Development] skyracer53:
i flashed the zip and it went through successfully, however the numbers on the terminal emulator were for the most part matching except a few of them. so i decided to try the other method and manually edit the files and flashed that successfully. result was the same.

so i guess my question is, do all the numbers have to match exactly as specified?

i am on the amaze 4g rooted with this rom btw: http://xdaforums.com/showthread.php?t=1362759

thanks!
[Droid Incredible Android Development] stiltzkin:
I'm not sure if I'm giving you the right answer on this, and maybe someone else can give a more definitive explanation - but from my own experience a couple of the values will always be changed slightly in practice. I chalked this up to the fact that I'm running Autokiller's advanced kernel tweaks, which probably mess with sysctl. And there could be other apps or settings involved as well.

So to answer your question, I believe that's more or less normal behavior, especially if you have other tweaks installed. I could certainly be wrong though.
[Droid Incredible Android Development] a.benjamin76:
mine flashed in literally less than a second. Did you guys experience the same thing? (just trying to make sure there's not an error or something)
[Droid Incredible Android Development] akhilez:
i wonder if this works on the evo 4g, i intend on using it anyways but would love an answer ty.
[Droid Incredible Android Development] metaphysical_calamity:
Try it ;)
[Droid Incredible Android Development] tgamble160:
No error it is very fast not a big file

sent via one badass kindle fire fueled by jellybeans
[Droid Incredible Android Development] akhilez:
I did

i did but seems like is not working, what i noticed is that using battery monitor widget pro, i used to get an estimated rate of 2 hours till empty, after using this FILE the estimated rate went to a day and 4 hours, i thought cool it worked but the phone kept on draining battery as usual and from 1 day went to 7h while using it for like 40 minutes.... buggy i guess, i also kinda noticed a change when the phone's led is off and i'm not using it that it lasts longer than be4, i like that, well i tried the command line to confirm the functionality of the mod n apparently it wasn't successful.

info:

1: I flashed the ZIP - nothing happen... :(

2: manually added the file in the phone with es file explorer... the results says no but a change was made but FAIL anyway.

I ran this on the HTC EVO 4G - first 4g mobile! because evo is love and love is evol... :confused::confused::confused::confused:
[Droid Incredible Android Development] Hero:
Completely replace the existing code. However, if there is already a value for say...vm.dirty_ratio (example), you have the option of keeping the original or replacing it with mine. Don't keep both.

Anyway, I updated the OP with a bit of info for those of you who want a brief idea of what this does. After reading it, you can deduce what the mods are actually doing to the phone.
[Droid Incredible Android Development] ChuckFarley:
You, sir, are a gentleman and a scholar.
[Droid Incredible Android Development] graymonkey44:
So just to be clear, this will work on the Rezound? And is compatible with any ROM?
[Droid Incredible Android Development] OMG_VTEC:
so i dont know if my rom is able to do this...

im running one of the cm7 kangs. i tried the thing with terminal but nothing happened...

does anyone know if itll work with those
[Droid Incredible Android Development] Hero:
It should definitely work with the Rezound. Just make sure that the ROM you are using has init.d support. I don't believe it's compatible with any ROM, but feel free to correct me.

What did you try with terminal? This?

grep busybox /init.rc

If you don't get the following output:

service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d

then your ROM doesn't support init.d, which is why the mod isn't working. You can get init.d support to work if you use dsixda's kitchen.
[Droid Incredible Android Development] kicsrules:
do you know if you can do this with stock roms ????
[Droid Incredible Android Development] Hero:
Yes you can
[Droid Incredible Android Development] d08speed3:
I flashed the Zip is there a way to see if its working?
[Droid Incredible Android Development] Hero:
Do this in the terminal

sysctl -a| grep vm
[Droid Incredible Android Development] downset00:
Does everything that I copied have to be on separate lines? I copied and pasted but it didn't separate the lines after ;. Just wondering if it matters. Thanks.
[Droid Incredible Android Development] Hero:
Nah it doesn't matter
[Droid Incredible Android Development] d08speed3:
$ export PATH=/data/local/bin:$PATH

$ sysctl -a| grep vm

sysctl: error reading key 'kernel.cad_pid': Permission denied

vm.overcommit_memory = 1

vm.panic_on_oom = 0

vm.oom_kill_allocating_task = 0

vm.oom_dump_tasks = 1

vm.overcommit_ratio = 50

vm.page-cluster = 3

vm.dirty_background_ratio = 5

vm.dirty_background_bytes = 0

vm.dirty_ratio = 20

vm.dirty_bytes = 0

vm.dirty_writeback_centisecs = 500

vm.dirty_expire_centisecs = 200

vm.nr_pdflush_threads = 0

vm.swappiness = 60

vm.lowmem_reserve_ratio = 32

vm.drop_caches = 0

vm.min_free_kbytes = 2618

vm.min_free_order_shift = 4

vm.percpu_pagelist_fraction = 0

vm.max_map_count = 65530

vm.laptop_mode = 0

vm.block_dump = 0

vm.vfs_cache_pressure = 100

vm.mmap_min_addr = 32768

vm.scan_unevictable_pages = 0

sysctl: error reading key 'net.ipv4.route.flush': Permission denied

sysctl: error reading key 'net.ipv6.route.flush': Permission denied

$

This is what I get
[Droid Incredible Android Development] Hero:
Let me update the permissions in the updater-script and see if it works then.

At least the main part stuck
[Droid Incredible Android Development] d08speed3:
Cool
[Droid Incredible Android Development] graymonkey44:
This is what I got.

# export PATH=/data/local/bin:$PATH

# sysctl -a| grep vm

sysctl: error reading key 'kernel.cad_pid': Permission denied

vm.overcommit_memory = 1

vm.panic_on_oom = 0

vm.oom_kill_allocating_task = 0

vm.oom_dump_tasks = 1

vm.overcommit_ratio = 50

vm.page-cluster = 3

vm.dirty_background_ratio = 25

vm.dirty_background_bytes = 0

vm.dirty_ratio = 0

vm.dirty_bytes = 20480000

vm.dirty_writeback_centisecs = 2000

vm.dirty_expire_centisecs = 1000

vm.max_writeback_pages = 1024

vm.balance_dirty_pages = 1

vm.dirty_ctrl_dev =

vm.nr_pdflush_threads = 0

vm.swappiness = 0

vm.lowmem_reserve_ratio = 32 32

vm.drop_caches = 0

sysctl: error reading key 'vm.compact_memory': Permission denied

vm.extfrag_threshold = 500

vm.min_free_kbytes = 2039

vm.min_free_order_shift = 4

vm.percpu_pagelist_fraction = 0

vm.max_map_count = 65530

vm.laptop_mode = 0

vm.block_dump = 0

vm.vfs_cache_pressure = 50

vm.stat_interval = 1

vm.mmap_min_addr = 4096

vm.highmem_is_dirtyable = 1

vm.scan_unevictable_pages = 0

sysctl: error reading key 'net.ipv4.route.flush': Permission denied

sysctl: error reading key 'net.ipv6.route.flush': Permission denied

#
[Droid Incredible Android Development] nizbot:
I see there's a bunch of IPv4 and v6 stuff in this script... would you happen to know the code to turn IPv6 off properly?

Thanks in advance.
[Droid Incredible Android Development] downset00:
This is what I got

a/local/bin:$PATH <

app_85@android:/ $ su

app_85@android:/ # sysctl -a| grep vm

vm.overcommit_memory = 1

vm.panic_on_oom = 0

vm.oom_kill_allocating_task = 0

vm.oom_dump_tasks = 1

vm.overcommit_ratio = 50

vm.page-cluster = 3

vm.dirty_background_ratio = 55

vm.dirty_background_bytes = 0

vm.dirty_ratio = 90

vm.dirty_bytes = 0

vm.dirty_writeback_centisecs = 500

vm.dirty_expire_centisecs = 200

vm.nr_pdflush_threads = 0

vm.swappiness = 0

vm.lowmem_reserve_ratio = 32

vm.drop_caches = 0

vm.min_free_kbytes = 2048

vm.min_free_order_shift = 4

vm.percpu_pagelist_fraction = 0

vm.max_map_count = 65530

vm.laptop_mode = 0

vm.block_dump = 0

vm.vfs_cache_pressure = 20

vm.mmap_min_addr = 32768

vm.scan_unevictable_pages = 0

sysctl: error reading key 'net.ipv4.route.flush': Permission denied

sysctl: error reading key 'net.ipv6.route.flush': Permission denied

app_85@android:/ #
[Droid Incredible Android Development] topnomi:
it doesn't look like anyone's asked yet...

does this work on ICS?
[Droid Incredible Android Development] Hero:
I'm not too sure, but you can try:

net.ipv6.icmp_echo_ignore_all=1

I haven't tested it yet, but theoretically it should.
[Droid Incredible Android Development] Hero:
To everyone whose been testing it out and posting their output, try changing the permissions using a root browser and see if it works. YOu will have to reboot after each permission change
[Droid Incredible Android Development] Alton (Halo 2):
After the a wat is that l ? Capital I ?
[Droid Incredible Android Development] ezeuba:
The | on terminal = VolUp+L
[Droid Incredible Android Development] khamsakamal48:
Could easily flash it on MIUI v 2.4.6 for HTC Incredible 2!

Cant confirm whether it is effective, anyway thanks!
[Droid Incredible Android Development] Hero:
This is just a hunch, but if you want to check to see whether the mod stuck, use the following codes:

sysctl -a| grep vm

sysctl -a| grep net

sysctl -a| grep fs

sysctl -a| grep kernel

If they allow you to see the changes, then I will add them to the OP
[Droid Incredible Android Development] Zerox8610:
Just installed on CM7 with Increikernel soooooo I'll see how it does tomorrow! Thanks!
[Droid Incredible Android Development] tomjoad2:
Done manually, but when a try to check with "sysctl -a| grep vm" I cannot see any changes
[Droid Incredible Android Development] sherpajosh:
So I flashed this onto my Inc with CM7.2 and nothing changed. So tried changing the permissions on both files to owner r/w/x and group r/x and then reboot. Still no luck, no change when I terminal sysctl -a| grep vm, still the old values.
[Droid Incredible Android Development] tomjoad2:
Same to me...
[Droid Incredible Android Development] TeeRom:
Installed on my Gnex, gonna see how well it works. Thanks.
[Droid Incredible Android Development] kubes069:
I am trying this with Incredible 2 running MIUI GB.

I too am getting permission denied when checking to see if the mod stuck or not.
[Droid Incredible Android Development] OMG_VTEC:
mine show permission denied only on the first one. all the other ones show everything fine...
[Droid Incredible Android Development] Hero:
Flashing the mod is what might be giving the error (probably since I forgot to set the permissions in the updater-script). So what it's doing is installing the mod, but not letting it do anything. Try doing the mod manually and then let me know if it works...
[Droid Incredible Android Development] Hero:
Also, the vm.xxxxx mods are the ones that have the main effect on battery life so if those stick, then you should be good for the most part.
[Droid Incredible Android Development] tomjoad2:
Is it possible that the mod works even if reading values with sysctl -a| grep vm doesn't changes?

I'm evalutating an incredible battery duration after composed mod (in 5 hour only 3% in MIUI with wi-fi and 3g always on). Maybe Crazy
[Droid Incredible Android Development] Hero:
It is possible. 3% drop in battery life after 5 hours sounds about right
[Droid Incredible Android Development] ferotakis:
$ export PATH=/data/local/bin:$PATH

$sysctl -a| grep vm

sysctl: error reading key 'kernel.cad_pid': Permission denied

vm.overcommit_memory = 1

vm.panic_on_oom = 0

vm.oom_kill_allocating_task = 0

vm.oom_dump_tasks = 1

vm.overcommit_ratio = 50

vm.page-cluster = 3

vm.dirty_background_ratio = 60

vm.dirty_background_bytes = 0

vm.dirty_ratio = 95

vm.dirty_bytes = 0

vm.dirty_writeback_centisecs = 2000

vm.dirty_expire_centisecs = 1000

vm.nr_pdflush_threads = 2

vm.swappiness = 30

vm.lowmem_reserve_ratio = 32

vm.drop_caches = 3

vm.min_free_kbytes = 4096

vm.min_free_order_shift = 4

vm.percpu_pagelist_fraction = 0

vm.max_map_count = 65536

vm.laptop_mode = 0

vm.block_dump = 0

vm.vfs_cache_pressure = 25

vm.mmap_min_addr = 4096

sysctl: error reading key 'net.ipv4.route.flush': Permission denied

sysctl: error reading key 'net.ipv6.route.flush': Permission denied

$

This is what I get :/
[Droid Incredible Android Development] sherpajosh:
So I followed your steps in the first post and I still get the old values from the terminal. I even tried changing the init script and still no luck. The new values are part of the system.conf file, but they are not being executed for some reason.

Does anyone have CM 7.2 ROM they have already baked this mod into that works?
[Droid Incredible Android Development] tomjoad2:
This is always what I get...exept for the last lines of that error that doesn't matter, the values always remains the same...but my battery duration seems improved anyway
[Droid Incredible Android Development] BarackMitzvah:
This sounds insane! Will be trying this on CM7 later.
[Droid Incredible Android Development] Hero:
Okay so some weird things have been happening with the terminal commands that do not register the changes made in the sysctl.conf. As long as you experience longer battery, then it's working.

In all honesty,

sysctl -p

is all that is really needed to run the script. So here are some more options:

If you think that init.d is being faulty, enter in terminal emulator

sysctl -p

and then

sysctl -a| grep vm

What this does is manually start up sysctl.conf and then verify it with the succeeding code.
​

OR

Ignore what

sysctl -a| grep vm

is outputting and just see if you experience better battery life (you should)​

This is what the script should be giving you in terms of battery-life: http://xdaforums.com/showpost.php?p=24728603&postcount=443 - Thanks to xdadevelopers-user for the picture.

There isn't much phone usage as indicated by the picture, but it's been on a single charge for 185 hours.
[Droid Incredible Android Development] graymonkey44:
I just edited the script, but I'm still getting the permission denied. I'm going to still test it out and see if I get better battery life though. I'm excited. Also, you can flash another kernel and it ain't affect the script right?
[Droid Incredible Android Development] Hero:
Yeah, you can safely flash another kernel