yashsingh1/xdaforums huggingface dataset:
[Droid Incredible Android Development] tiny4579:
So I think I know what's going on. I was getting short write errors each time I ran sysctl -p and I checked the output with sysctl -a | grep vm, so I knew it wasn't taking. After no luck googling I took out extra lines, mostly the net stuff, and duplicate entries as there are duplicate entries. I also removed the semicolons thinking it would help. Not sure if it does or not but the combination of the two works and the

sysctl -a | grep vm results actually update.

Edit: Here is the link to my sysctl.conf if anyone is interested:

http://dl.dropbox.com/u/31805083/sysctl.conf

Also, if you're running any other mods that may mess with sysctl values and you want these to stick, the best way is to name the init.d script S99Sysctl and it should run after even v6 supercharger if you're using that.
[Droid Incredible Android Development] BarackMitzvah:
Did it work?

$ 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 = 30

vm.lowmem_reserve_ratio = 32

vm.drop_caches = 3

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

Sorry if this has already been answered I'm just so excited haha
[Droid Incredible Android Development] withbloodskies:
Flashed the zip on cm7 7.2 and I think it's working.

Going for a full charge so we will see.
[Droid Incredible Android Development] denzel09:
Thanks for this
[Droid Incredible Android Development] Prashanthme:
@Pure Motive

Hi dude actually i m on galaxy ACE. One of my friend in our community made a flashable zip file putting this sysctl file. But now i noticied NO change in battery life. I wonder do we need to enable the sysctl.conf using TE??

Waiting for reply!! :)
[Droid Incredible Android Development] Hero:
You do not need to enable it in TE if you already have an init.d script set up. However, if you want to manually enable in in TE, run the following code:

sysctl -p
[Droid Incredible Android Development] graymonkey44:
So I just had something strange happen. The screen turned dark blue and I couldn't see the battery meter. I don't know if it can be attributed to this mod, but I've never experienced it before. I did a restart and it hasn't happened again, though.
[Droid Incredible Android Development] Hero:
This mod shouldn't happen because of this mod. You may want to contact the dev of your rom.
[Droid Incredible Android Development] Hero:
Yeah it's not working. Set the correct permissions, reboot, and re-run sysctl -p
[Droid Incredible Android Development] .Harshit:
Could you tell me what are the correct permission setting for

/system/etc/init.d folder

/system/etc/init.d/10sysctel file

/system/etc/sysctl.conf
[Droid Incredible Android Development] tiny4579:
You need to type su first to run the sysctl -p command correctly. As far as permissions on files the main one to be concerned with is 10sysctl which should be read write execute on everything.
[Droid Incredible Android Development] sherpajosh:
Used your modified sysctl file, changed the init.d script name and made sure all permissions were set and it finally stuck. Terminal shows the new values. Now I hope the battery life goes way up. Thanks so much.
[Droid Incredible Android Development] ferotakis:
Tips pls

Ie which perm what name end etc.
[Droid Incredible Android Development] graymonkey44:
This.... I have no idea on how to correct the permissions.
[Droid Incredible Android Development] tazlooney89:
can someone tell which are the correct permissions for each file, please
[Droid Incredible Android Development] ferotakis:
Long pres on file with rootex open the menu and there is perm.

I ask once again this user above who say stuck and terminal show the right values ... WHAT ARE THE PERM YOU ARE SET AND WHAT THE NAME YOU GIVE THE FILE ?!!!

Coz I think you lie there , coz I set all posible combo of perm , all posible name of init.d initializator file , all posible perm to initializer file tooo , all the combo of lines for initializer file , all the way of manual start sysctrl via terminal and no change at all.

How can this not work on me and start work on you ?

Can you just tell us what perm name set and one screenshot from terminal will be good to.

Coz I know how to fake usage stats files in system too ;) coz I know how the baterry info in system about phone can show 7 days 50 h 20 mins ;) I can make mine show 1year 12 monts 31 days 24hours 59 mins and this value on 97% batt which mean 3% drop for 2 years :D

In the end we are human there not sort of animal ... I mean we not stupid.

Thk u anyway.

I'm still try make mine to work when I'm done then I'm upload some feedback
[Droid Incredible Android Development] sherpajosh:
I changed the permissions of both files to to read/write/execute for owner and group. You can use root explorer, make sure you are read/write and long press over the files, permissions and check off each one, then reboot.
[Droid Incredible Android Development] ferotakis:
Thk u.

I make mine in this way too but no luck.

Which ROM and Kernel are u using?
[Droid Incredible Android Development] tazlooney89:
ok, I have permissions rw--r--r apparently the scrip and it works, I will charge the phone and will wait to see results for comment
[Droid Incredible Android Development] McDastardly:
What is the output from terminal when the script is working when you run sysctl -p?
[Droid Incredible Android Development] graymonkey44:
+1
[Droid Incredible Android Development] WildZontar:
Does anyone have a controlled, repeated test to see if this is any good?

If not, I may do one later on myself and post the results here. I just would like to know if this will work with CM7 and Incredikernel 2.6.38.8?
[Droid Incredible Android Development] d08speed3:
$ export PATH=/data/local/bin:$PATH

$ su

# sysctl -p

sysctl: short write

# 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 = 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

#

What to do now?
[Droid Incredible Android Development] josh0426:
After using Tinys config file I still get the permission denied, I'm on a Thunderbolt by the way. So is the rest working??
[Droid Incredible Android Development] tiny4579:
Yeah that should be fine. Its just the couple settings that fail.
[Droid Incredible Android Development] d08speed3:
So is mines working now even tho those bottom values failed? So the "mod" is running?
[Droid Incredible Android Development] tiny4579:
I always checked the output of dirty_ratio and it should be 90 based on the mod. Yours was 20. The short write means that sysctl -p probably failed. Try my sysctl file a few pages back. It just doesn't have the net tweaks in it.
[Droid Incredible Android Development] musical_chairs:
Tiny's config applied without the short write error and the phone is working fine. But for some reason the dialer is really chomping on battery now, whereas before the mod it rarely showed up in the stats.
[Droid Incredible Android Development] Hero:
I updated the OP with a new code (Thanks to Tiny). I just removed the semicolons. Use this version if the other does not work for you.
[Droid Incredible Android Development] orfius christ:
So will the .zip work at all or is it like a 50/50 of actually helping?
[Droid Incredible Android Development] McDastardly:
I've switched to the non semi colon ending version and here is the output. Is this what I should see?

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

$ su

# sysctl -p

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.sched_compat_yield = 1

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

net.core.wmem_max = 524288

net.core.rmem_max = 524288

net.core.rmem_default = 262144

net.core.wmem_default = 262144

net.core.optmem_max = 20480

net.unix.max_dgram_qlen = 50

net.ipv4.tcp_keepalive_time = 900

net.ipv4.tcp_keepalive_probes = 5

net.ipv4.tcp_keepalive_intvl = 156

net.ipv4.tcp_timestamps = 0

net.ipv4.tcp_sack = 1

net.ipv4.tcp_fack = 1

net.ipv4.tcp_window_scaling = 1

net.ipv4.tcp_tw_recycle = 1

net.ipv4.tcp_tw_reuse = 1

sysctl: short write

#
[Droid Incredible Android Development] Hero:
You need to do "sysctl -a| grep vm" (without quotes). "sysctl -p" just initializes sysctl.conf
[Droid Incredible Android Development] DroidOnRoids:
Will this mod work for the Galaxy Nexus CDMA? As you all know, the GNex desperately needs increased battery life lol

EDIT: Okay, just tried it and everything boots up. Don't know yet if it helps battery but will report back. Also, when I put that command in emulator to see if it works, I get some permission denied reading as: "systctl: error reading key 'kernel.cad_pid'"

"systctl: error reading key 'kernel.usermodhelper.inheritable'"

"systctl: error reading key 'kernel.usermodhelper.bset'"

"systctl: error reading key 'vm.compact_memory'"

"systctl: error reading key 'net.ipv4.route.flush'"

"systctl: error reading key 'net.ipv6.route.flush'"

Everything else checks fine except those. Could it have something to do with me using V6 Supercharger?
[Droid Incredible Android Development] sherpajosh:
Using CM7.2 with incredikernel 8/15
[Droid Incredible Android Development] superbeak:
PureMotive, you are now my favorite dev.
[Droid Incredible Android Development] nyonya:
Using the sysctl.conf from the first page (either with or without semicolons) doesn't work for me - get the 'short write' message in terminal when trying to execute sysctl -p. Using the file Tiny uploaded seems to work, will give that a try. Just an fyi.
[Droid Incredible Android Development] kevdliu:
i just removed everything net.* and worked fine thereafter. i guess one of the net.* is causing the shortwrite and halting everything after it
[Droid Incredible Android Development] tiny4579:
I think it's either too many commands/lines or the file's too big. I'm not too sure.
[Droid Incredible Android Development] graymonkey44:
So I just edited the script again without the colons and the 1st were denied and the last line were. Are these a crucial part of the script?

Edit: it looks like the ipv4, ipv6, and compact memory were denied.
[Droid Incredible Android Development] Hero:
The net tweaks aren't that important. Just be sure that the vm ones are working, which they appear to be in your case.
[Droid Incredible Android Development] nelms:
ive tried everything.. no luck. it wont stick. values are correct in sysctl.comf file but will not execute. tried changing permissions on sysctl, init.d and conf. still no go. also tried tinys script. even went as far as to full wipe. nothing. any ideas?
[Droid Incredible Android Development] chocolate8175:
I manually changed some values using the kernel tweaks utility on the rom toolbox app, is that pretty much the same effect?
[Droid Incredible Android Development] Hero:
Yes, but this mod edits more than what rom toolbox is capable of. Of course, you could edit the sysctl.conf file using the root browser in the app...
[Droid Incredible Android Development] vick007:
thanks a lot, but i only got 13 mb free (ram) after applying :s it´s imposible to use it :( it is the slowest cell phone jeje

I used semi-colons removed, may be because that?? (i got naa version)
[Droid Incredible Android Development] chocolate8175:
I did that initially but it seemed that some of the values weren't sticking, I checked by running sysctl -a| grep vm in terminal emulator. Like vm dirty ratio was 90 when I copied it into sysctl.conf, but then when I ran the above command it would show 20. Did I do something wrong somewhere? Thanks for any knowledge dropping you can provide
[Droid Incredible Android Development] BarackMitzvah:
Same here on CM7 using the edition d version without the ;'s
[Droid Incredible Android Development] cmlusco:
Here is the one that worked for me http://dinc.does-it.net/Mods/sysctl.conf. It is the one from the op with a few lines and the ; removed that were causing short write errors, and not found errors.

Tiny i had to remove a few more lines from yours also to get it to work without short write errors.

I do use V6supercharger, but have sysctl set to run after V6. I also have zram enabled if that makes a difference.
[Droid Incredible Android Development] tiny4579:
Are you getting a short write error after running sysctl -p? If so thats why. The sysctl -p fails entirely if you get the short write error.
[Droid Incredible Android Development] dymmeh:
I tried out your modded sysctl.conf and it didn't work right off the bat. It wrote a few lines and then stopped with the write short error.. I removed all of the networking related stuff and tried again (sysctrl -p) and it ran without any errors.

magic?
[Droid Incredible Android Development] cmlusco:
Glad it worked. Sounds like settings are different for everyone. I had to remove a couple net tweaks but not all of them. Battery life does seem better so far.
[Droid Incredible Android Development] chocolate8175:
Here's a screenshot of what I'm getting...
[Droid Incredible Android Development] d08speed3:
Can someone make a new flashable .zip that works this time :( all of this is so frustrating lol :)
[Droid Incredible Android Development] nelms:
i get the short write error after i full wiped and started from scratch. when i do sysctl -p . is that normal?
[Droid Incredible Android Development] BarackMitzvah:
What can I do to fix this? I go to run sysctl and immediately get the short write. What does short write mean? Is the file too large? I'm on CM7 (more details in my sig) on an HTC Incredible AMOLED. Any insight is greatly appreciated!

Thanks in advance!

Edit: would updating busybox help at all?
[Droid Incredible Android Development] kevdliu:
i created a flashable zip of everything except the net.* tweaks as that was causing problems for me.

download is here: http://www.mediafire.com/?j3gdgdcawj9imcq

havent tested it yet and its not guaranteed to install on every phone as there are different mount points for /system
[Droid Incredible Android Development] nelms:
its not working for me. im on aokp m5, (not sure if its rom related or not)

kevdliu, what output does your sysctl -p show? (bout to flash zip)
[Droid Incredible Android Development] kevdliu:
if everything is working right it should show a list of <key>=<value>
[Droid Incredible Android Development] BarackMitzvah:
I didn't flash it, but for whatever reason when I replaced my version with yours it worked. Thanks! What did you change in that one vs. the OP's?
[Droid Incredible Android Development] kevdliu:
i used the one without the semi-colons and removed all the net.* tweaks
[Droid Incredible Android Development] BarackMitzvah:
Lol, now for whatever reason I can't get my init.d script to start the damn thing, go figure lol.
[Droid Incredible Android Development] nelms:
screenshot couldnt capture it all... here is the text.

a/local/bin:$PATH <

app_54@android:/ $ su

app_54@android:/ # sysctl -p

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.sched_compat_yield = 1

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

app_54@android:/ #

whats up with all the kernel errors? any guesses?
[Droid Incredible Android Development] BarackMitzvah:
Got those too, I just figured my kernel was good on it's own and removed the ones getting the errors.
[Droid Incredible Android Development] Hero:
Try the revised init.d code and see if it works.

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

I edited the OP so that there are no more net tweaks. Seems as though they are conflicting with the other tweaks :/
[Droid Incredible Android Development] BarackMitzvah:
No luck :/
[Droid Incredible Android Development] nelms:
same here. no go with init.d
[Droid Incredible Android Development] BarackMitzvah:
What rom are you running?
[Droid Incredible Android Development] nelms:
aokp milestone5 (4.0.4) im thinking it has something to do with the "rom control" settings menu cause you can enable sysctl tweaks and such from there. all the commands i see in my init.d folder have something to do with liberty (rom toolbox) kinda stuff. so i dont know what path to make the init.d do
[Droid Incredible Android Development] thekendog:
Worked for me.
[Droid Incredible Android Development] tiny4579:
Name your init.d file S99Sysctl if you're having problems applying the tweaks. That way this file will override most tweaks due to order rules.
[Droid Incredible Android Development] nelms:
heres my init.d file, hope it helps

tiny is that a good idea seeing that im using the built in sysctl file instead of making another one like the op said?

are you talking about my failed kernel lines in the screenshot?
[Droid Incredible Android Development] sfreier:
Holy crap!!! Amazing results with ICS battery life! Thanks for everyone's hard work!!!!
[Droid Incredible Android Development] Hero:
Just out of curiosity, how much of an increase in battery life are you getting on ICS? I want to know whether it matches the GB + Sense ROMs.
[Droid Incredible Android Development] nelms:
which rom?
[Droid Incredible Android Development] sfreier:
Currently running Evervolv 2.2.0 Alpha1 ICS ROM with Tiamat's Kernel

Still testing but am very excited by the results.

I was just streaming music over slacker for nearly two hours and only went from 66% to 62%.
[Droid Incredible Android Development] Hero:
Cool beans :)
[Droid Incredible Android Development] nelms:
im experiencing more rapid battery loss than normal. like 1% per every 3 min or so. what did i do wrong... (i must suck at this...)
[Droid Incredible Android Development] asdot:
Same here, some value unknown key. And sometime freeze if vm.oom_kill_allocating_task = 1

Sent from MARVEL
[Droid Incredible Android Development] AeonWorld:
I think this helps , dont know if its the base band , but didn't lose 1% over 5-6 hours in sleep (screen off aeroplane mode on)

MK16i

Rooted|Xperia S|MEgabass|beats|init.d
[Droid Incredible Android Development] ferotakis:
Airplane modes not count :D
[Droid Incredible Android Development] musical_chairs:
This mod sure seems to be helping here. I'm running Ice Cream Senseless, still using the config posted by Tiny a few pages back. The only thing weird is that the Dialer process (Probably an htc/sense thing) is eating the battery. After a day in which I made at most four phone calls, the battery usage stats show Dialer using 12% of my battery.

Even so, it looks like my battery life has been about doubled. If I could get Dialer to behave, we would really be rockin'.
[Droid Incredible Android Development] tiny4579:
Remember battery percent is based on percent of the drain and not how much of a percent drop you took. Also if kernel and os tweaks are helping, things like screen and cell radio usage would naturally be higher even with the same use. And I think HTC dialer is basically the representation of phone call drain. 12% doesn't surprise me. Hope I'm making sense.
[Droid Incredible Android Development] LunaticSerenade:
Any idea if this will work on the Rezound? I can send you my sys.conf if you like.

Or just try it I guess. :what:
[Droid Incredible Android Development] ferotakis:
Read , try , see , report back
[Droid Incredible Android Development] graymonkey44:
I've been testing on the Rezound with ineffabalis 1.4 and I haven't noticed any increase in battery life. If anything, I think it may have gone down. I've been trying all the different codes and seeing which ones stick.
[Droid Incredible Android Development] Hero:
try different ROM/kernel combinations. It may make a difference...
[Droid Incredible Android Development] graymonkey44:
All right, I'll try that. I'm using incredikernel beta 7, too, if that would cause some incapatability?
[Droid Incredible Android Development] loudaccord:
Are you using this on your Nexus also?
[Droid Incredible Android Development] OMG_VTEC:
I haven't noticed any change... However I'm not sure I even did it right
[Droid Incredible Android Development] cmlusco:
Since installing this tweak i have been having issues with apps closing, not force closing just exiting in the middle of using them. Sometimes right after an app closes on its own the phone will do a full reboot. If i remove the tweak, it stops happening. Not sure which tweaks are causing the issue.
[Droid Incredible Android Development] mushat3k:
I had this same issue, happened with google reader. I am running aokp m5 with hwa and incredikernel for hwa beta 1