Related
So I'm new to phone hacking, but an experienced software developer with a pretty strong Linux background... Anyway, I was rooting around the filesystem and found /sys/devices/system/cpu/cpu0/cpufreq/
I checked the values in scaling_max_freq and scaling_min_freq and they were both set to 528000. After doing some forum searching I see that some people mention using setCPU to let their CPU throttle down to 245 MHz when the screen is off, but when I tried to do echo 245000 > scaling_min_freq it doesn't ever change from 528000
I'm using Fresh 1.1, do I need to install a different kernel if I want my CPU to scale, and why can't I edit this file manually? I assumed that all setCPU was doing was editing /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor and scaling_max_freq and scaling_min_freq
ASULutzy said:
So I'm new to phone hacking, but an experienced software developer with a pretty strong Linux background... Anyway, I was rooting around the filesystem and found /sys/devices/system/cpu/cpu0/cpufreq/
I checked the values in scaling_max_freq and scaling_min_freq and they were both set to 528000. After doing some forum searching I see that some people mention using setCPU to let their CPU throttle down to 245 MHz when the screen is off, but when I tried to do echo 245000 > scaling_min_freq it doesn't ever change from 528000
I'm using Fresh 1.1, do I need to install a different kernel if I want my CPU to scale, and why can't I edit this file manually? I assumed that all setCPU was doing was editing /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor and scaling_max_freq and scaling_min_freq
Click to expand...
Click to collapse
I dont know alot about linux or the kernel stuff but I do know that those of us that have been using SetCPU to adjust freqency have been installing a seperate kernel. Its Gumbo Kernel. Ill get you a link.
Gumbo Kernel
http://forum.xda-developers.com/showpost.php?p=5502421
Looks like there's a script in there that fiddles with the memory freer and sets the scaling_governor to performance instead of ondemand or msm7k.
Changes /sys/module/lowmemorykiller/parameters/minfree 1536,2048,4096,5120,5632,6144
to 1536,3072,4096,21000,23000,25000 that's interesting.
edit: I'm not sure how useful that really is. Memory that isn't storing anything isn't doing anything, and so while it might make you feel better to say "Look! I have 90 mb free!" that really isn't as great as you'd think. If you run low on memory (ie the active process is needing more), then it's already going to kill and free up empty apps and content providers with no clients attached, so not really sure how useful that particular part really is.
edit2: So returning to my original question. If I want to change how low my CPU will scale down to, I need to install a new kernel?
ASULutzy said:
Looks like there's a script in there that fiddles with the memory freer and sets the scaling_governor to performance instead of ondemand or msm7k.
Changes /sys/module/lowmemorykiller/parameters/minfree 1536,2048,4096,5120,5632,6144
to 1536,3072,4096,21000,23000,25000 that's interesting.
edit: I'm not sure how useful that really is. Memory that isn't storing anything isn't doing anything, and so while it might make you feel better to say "Look! I have 90 mb free!" that really isn't as great as you'd think. If you run low on memory (ie the active process is needing more), then it's already going to kill and free up empty apps and content providers with no clients attached, so not really sure how useful that particular part really is.
edit2: So returning to my original question. If I want to change how low my CPU will scale down to, I need to install a new kernel?
Click to expand...
Click to collapse
Yes. Try the gumbo kernel. try scaling it to 160 just for fun. You'll see how slow it is, and it will prove that the cpu scaling works. try it at 528 also.
UPDATE: Try BulletProofing Apps with my latest V6 SuperCharger Script! Use the following link OR use the link in my signature
I didn't want to risk making the SuperCharge & Bulletproof thread too confusing so I figured it best to make a "sister" thread.
This is a work in progress.
But if this information is helpful, please click the thanks button
HUGE thanks to Feeyo and Bear in NM for helping me figure out a workable solution on locking a background app in memory on boot up.
Feeyo gave me the gist of it but it wouldn't work on boot.
After posting in this thread at Droid Forums, things got rolling - with alot of help from Bear in NM.
Create a Unix script file with no extension (I named it 97oom) with Notepad++ and put it in your i/system/etc/init.d/ folder and put this inside:
Code:
#!/system/bin/sh
sleep 60
PPID=$(pidof [B]com.estrongs.android.safer[/B])
echo "-17" > /proc/$PPID/oom_adj
Permissions: chmod 755 /system/etc/init.d/97oom (same as 10overclock)
You can also do it on the phone itself:
1. Make a copy of 10overclock
2. Renamed it to 97oom (I have a 98governor and a 99complete so...)
3. Deleted the text and put the text you see above
4. Set permissions
Then reboot to test!
You can check to see if it worked with either Auto Memory Manager (AMM) or AutoKiller Memory Optimizer (AKMO).
The bold text in the above code is the process name of the app that you want to protect!
Note: You can get the process name from most process monitors or with AKMO or AMM.
That command "as is" will give ES Security Manager the highest priority of -17.
AKMO shows it as being ignored by the OOM killer
At first it wasn't working on boot because ES Security was not yet loaded in memory.
The "sleep 60 "command fixes that by waiting 60 seconds to execute the command
You can also do this in GScript Lite with this:
Code:
PPID=$(pidof com.estrongs.android.safer)
echo "-17" > /proc/$PPID/oom_adj
This comes in handy for apps that don't load on bootup - just run a GScript for those apps
I suggest you get Busybox Installer and have it install the latest BusyBox (v1.19).
This ensures GScript doesn't spit out ugly stderr: messages.
GScript Tip: 1. Make a file (with any text editor) with the commands
................. 2. Rename it with an .sh extension (example 97oom.sh)
................. 3. Put it in sdcard/gscript folder
................. 4. Run GScript, Menu key, Add script, and click Load file, select a script and Save (leave SU checked)
Even better, you can make shortcut for any GScript.
Long press desktop > Shortcuts > GScript Lite > Select... BOOYA!
As I said, this is a work in progress.
Taming the OOM Killer explains that an app will be ignored by the OOM killer if it has the -17 priority.
The problem is that Android will still shuffle it's priority downwards like it does with any inactive app.
If that happens, then the app reverts to it's usual priority.
This is why ESS will lose it's -17 after a couple of hours. It just sleeps ALL the time.
My thinking that if a more active background app, such as an SMS app or a music app is given the -17, it won't lose it's priority at all.
Feedback with results is more than welcome!
No need to set a variable, just use back-ticks:
Code:
echo -17 > /proc/`pidof [B]com.estrongs.android.safer[/B]`/oom_adj
Although that may be a little too complicated for some people to type in. Best to keep it simple I suppose...
That's pretty cool.
I figure most people would copy/paste the whole thing and replace the process name.
So maybe the back ticks wouldn't be a big deal.
That is why I try and avoid putting any code I use on forums. Someone who actually knows what they are doing will always come along and whack me ;^)
Seriously, good work Zep.
Craig
I don't mind.
That's all a part of learning so it's always good that there's somebody around that's "smarter" at something than me.
For example... this script I'm trying to get working for supercharging stock phones...
On custom roms, CM and FroyMod at least, I'd modify /system/etc/rootfs/init.mapphone_umts.rc
I flashed stock telus 2.2 and the path seems to be just /init.mapphone_umts.rc
I don't see rootfs anywhere
But there is a rootfs is mounted
To mount as rw, "mount -o remount,rw /system" doesn't work
In gscript, I'm getting "sed not found" errors too.
grrr...
how well do you think this would work with handcent? it's a little laggy to load up on my phone, but i want to try it out more. will keeping handcent in memory eat up ram that i need otherwise? and do you think it will be active enough to keep it's -17 after a few hours? thanks
edit: i was trying it out, it disappeard from processes withing a few minutes. oh well, maybe it doesnt need to be running anyway
Did you check with AMM to see if handcent had the high priority or if it really got killed?
ya, i checked. it was set to -17, then next time it refreshed it was gone. then i opened handcent, went back, and the process had a different pid, not oom level. oh well
damn
Maybe some apps are too prone to get killed off and the only way to keep them alive is with multitasking friendly minfree values
zeppelinrox said:
damn
Maybe some apps are too prone to get killed off and the only way to keep them alive is with multitasking friendly minfree values
Click to expand...
Click to collapse
Yes, I've seen the same happening with the stock SMS app. I did not receive SMS anymore so I decided to look at it a bit closer (using adb logcat). I started the SMS app, noted down the PID and set the oom_adj value to -17 using adb shell. A few seconds later it was killed. Setting the minfree values back to system default allows me to receive SMS again. Also whatsapp, gtalk and push mail now work reliable. With high minfree values I could see in the logs that, when a message arrived the app is started and immediately killed afterwards. So, I was never notivied that a SMS or whatsapp message had arrived. With default minfree values it seems to work more reliable.
But it all depends on how you use your phone, I guess. I'm using it as my communication central and don't want to miss any message. If you use it more as your mobile gaming or surfing device you might still be better off with high minfree values.
I agree.
That's why I made 6 different profiles.
The multitasking and balanced 2 settings, for example, will leave you with more free ram but are actually more background app friendly than stock google/android values.
zeppelinrox said:
I agree.
That's why I made 6 different profiles.
The multitasking and balanced 2 settings, for example, will leave you with more free ram but are actually more background app friendly than stock google/android values.
Click to expand...
Click to collapse
I see. I did not realize that. It seems I've been reading your post too superficially.
I'll give those settings a try. I've just lost another SMS (this time with the default setting)
If I can't get this under control I might go back to CM6. I understand this is not as memory hungry as CM7 is.
Well, handcent is a giant pain in the ass.
I'm running stock telus froyo and the thing doesn't even stay loaded and I'm not even doing anything.
I run it.
Try and bulletproof it with a gscript (and sometimes handcent is even killed off if I take too long opening gscript lol)
The script won't even change the priority of hancent.
It stays at an 9 or 10 in the content provider grouping.
But the thing is a pig anyway.
20+ mb of ram used up and the app itself is close to 5 mb.
Maybe froyo has a reason to not like it? LOL
very very important and informative post!
thank you!
one question: any idea why "Auto Memory Manager" isn't avialable to
milestone according to market?
I can't install it from market site and wasn't able to find it in market application?
zeppelinrox said:
Create a Unix script file with no extension (I named it 97oom) with Notepad++ and put it in your i/system/etc/init.d/ folder and put this inside:
Code:
#!/system/bin/sh
sleep 60
PPID=$(pidof [B]com.estrongs.android.safer[/B])
echo "-17" > /proc/$PPID/oom_adj
Permissions: chmod 755 /system/etc/init.d/97oom (same as 10overclock)
You can also do it on the phone itself:
1. Make a copy of 10overclock
2. Renamed it to 97oom (I have a 98governor and a 99complete so...)
3. Deleted the text and put the text you see above
4. Set permissions
Click to expand...
Click to collapse
I did it, and after reboot stock sms app (com.android.mms) is killed, I cheched in AKMO, and that fix didn`t help, so I set default minfree values in AKMO (although the previous settings weren`t so strict)
Ok, first off, I am a UK Milestone, running Cyanogenmod 7 RC4. I am trying to raise the oom_adj of COM.ANDROID.MMS and I just used the method zeppelinrox posted instead of the proposed alternative (though I did try that too) and the startup command seems to do nothing. So I decided to try the GScript way and I get this:
Code:
stderr:
stderr:
stderr:
stderr:
stderr:
stderr: cannot create /proc//oom_adj: directory nonexistent
stderr:
stderr:
stderr:
I have never used GScript before and maybe I am doing something wrong here, but I am running it the script as superuser, I have exactly what zeppelinrox has (except a change for the messaging app process name) and I am at a total loss here. Other methods worked fine on my RC3 and keep Messaging as a "Foreground Group" app, but in RC4 it is an "Empty" and that means it will likely get killed a lot. I am using stock minfree values, just using AMM to check oom. I don't want to be missing texts, so any help would be greatly appreciated. Let me know if you need anything else.
You get that "directory nonexistent" error because the app was already killed so there is no PID anymore.
I suggest you get Busybox Installer and have it install the latest BusyBox (v1.19).
This ensures GScript doesn't spit out ugly stderr: messages.
I finally installed CM7 for the first time and RC4 at least does have the option to lock messaging app in memory.
It's sitting in the foreground with a 0 priority
I thought that maybe it was killed already also, but I opened Messaging -> checked System Panel to ensure it was running -> ran the GScript (which failed as noted before) -> and checked System Panel once more and it was still running. Maybe I am crazy here..
I am using the "Lock messaging in memory" but "Messaging" process is still killed by the stock manager, is it still alive in some separate process? It certainly is not 0 priority in Foreground, still sitting in "Empty" at something generally over 4 priority.
I will probably just switch back to the previous build as all was well there, though I would like to be able to keep up with the newest features.
Thank you for the Busybox link, I will try that.
That's strange.
Maybe that setting needs a reboot?
I remember seeing messaging in content provider earlier and then I was actually surprised to see it in the foreground.
I actually checked to see if I still had the 97oom file in the init.d folder but it's not there.
But it should be immediate because if I uncheck Lock messaging in memory, it gets instantly killed.
I run it, check lock messaging again, and AMM shows it in the foreground group again.
Stderrs... now I dunno what's going on with that
GScript was working perfectly in stock Telus rom without stderrs after installing busybox (to get certain commands to work).
But in CM7, after updating busybox, stderrs all over the place.
Now I have to figure this out.. those stderrs are annoying as hell
zeppelinrox said:
You get that "directory nonexistent" error because the app was already killed so there is no PID anymore.
I suggest you get Busybox Installer and have it install the latest BusyBox (v1.19).
This ensures GScript doesn't spit out ugly stderr: messages.
I finally installed CM7 for the first time and RC4 at least does have the option to lock messaging app in memory.
It's sitting in the foreground with a 0 priority
Click to expand...
Click to collapse
What am I missing here? I'm looking at my CM7 Milestone right now with the "lock messaging app in memory" selected. And the messaging app is sitting in "background". Then I set the oom_adj value to -17 and a few minutes later messaging is gone. I'm starting to become desperate.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Before we get to the mod, I want to get a little personal. I make these mods so that your Android experience will be enhanced. If you find something wrong with the mod then provide constructive criticism. Don't just sit there behind your computer and degrade the effects based on what you see in the code, especially if you are even unwilling to try the mod in the first place. That irritates the hell out of me and unfortunately, I can't help you with your issues...so do yourself and others a favor and either use the mod and provide constructive criticism such as results (positive or negative) or ways to improve it or don't use it at all. That being said, these tweaks work in conjunction with each other, they are not each meant to increase your battery life.
This is my mod for achieving good-great battery life. This is the mod I use in Anthem™ which has given me 50+ hours on a single charge. The increase in battery life may not be "tenfold" for you, but it does increase, which is still better than not increasing. Contact me before including it in your own ROM (that you plan on publicly releasing). I will allow you to use it, just ask first. Please give credit or thanks or both
First: Here is a flashable .zip of the mod that may or may not work with your ROM. I'd still advise doing it manually.
Sysctl.conf - Updated May 3, 2012Requirements:
HTC Incredible (preferably)
Kernel with zram swap (for swappiness)
Kernel with init.d support
Currently working on:
HTC Incredible - Anthem, Clutch, AOKP, ICSenseless
HTC Amaze 4G
Step 1
Open up your ROM.zip (or whatever it's called) in 7zip (Windows) or Betterzip (OSX) and locate
sysctl.conf in /system/etc
If it's not in this directory, create it.
Step 2
In your sysctl.conf file, paste the following code and save it.
Code:
#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;
If the above code does not work for you, try this one. It has the semi-colons removed. Thanks Tiny
Code:
#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
Step 3
Now we need to enable it. So, navigate to /system/etc/init.d and create a file with the following code:
Code:
#!/system/bin/sh
# grep sysctl /etc/init.d/*
# Load /sys/etc/sysctl.conf
sysctl -p
sysctl -p is what initializes the code.
Just FYI: You don't actually need these lines:
Code:
# grep sysctl /etc/init.d/*
Code:
# Load /sys/etc/sysctl.conf
So this would have just sufficed.
Code:
#!/system/bin/sh
sysctl -p
If the above code does not work for any reason, try this:
Code:
#!/system/bin/sh
sysctl -p /system/etc/
Name your file something like this 10sysctl
Save your file.
NOTE: Your ROM must support init.d. You can do this by using dsixda's android kitchen
Step 4
Save your ROM and install it via recovery
OR
you could just push the files into your current ROM and try them out.
Credits to imoseyon for portions of the info
Ok, so what exactly is sysctl.conf?
The sysctl.conf is a configuration file for "sysctl" which is an interface for dynamically changing kernel parameters in the Linux OS. The configuration file contains the following elements, vm.min_free_kbytes, vm.dirty_ratio, vm.dirty_backgroud_ratio, vm.vfs_cache_pressure, vm.oom_kill_allocating_task. There are many other elements within the file, but we will be primarily focusing on these specifically (the vm prefix stands for virtual memory). The sysctl.conf file should be located in /etc (/system/etc) by default. To enable it you need your ROM to execute "sysctl -p" somewhere during the boot process (or shortly afterward). We will also be discussing how to enable it if it is not already done so. You can also run sysctl -p manually to enable it any time after the OS is started.
Now, let’s get down to what sysctl.conf does and how it works.
min free kbytes (vm.min_free_kbytes)
This is used to force the Linux VM to keep a minimum number of kilobytes free. The VM uses this number to compute a pages_min value for each lowmem zone in the system. Each lowmem zone gets a number of reserved free pages based proportionally on its size. Default is 2048kb.
dirty ratio (vm.dirty_ratio) and dirty background ratio (vm.dirty_background_ratio)
This controls how often the kernel writes data to "disk" (in our case the internal microSD system card, not the removable microSD card). When your apps write data to disk, Linux actually doesn't write the data out to the disk right away, it actually writes the stuff to system memory and the kernel handles when and how the data is actually going to be flushed to the disk. These values represent a percentage, the higher the percentage, the longer it waits to flush, the lower the percentage, the more often flushes will occur. Now remember, we are dealing with solid state storage, not the traditional disk platter and spindle. So we are actually able to delay flushes a little longer with solid state versus a traditional hard drive disk.
VFS Cache Pressure (vm.vfs_cache_pressure)
Now here is where it gets interesting! File system cache (dentry/inode) is really more important than the block cache above in dirty ratio and dirty background ratio, so we really want the kernel to use up much more of the RAM for file system cache, this will increas the performance of the system without sacrificing performance at the application level. The default value is 100, as a percentage, and what you want to do is lower the value to tell the kernel to favor the file system cache and not drop them aggressively.
oom allocating task (vm.oom_kill_allocating_task)(enable or disable, generally in Linux this value is either a "1" or a "0," representing as on or off.)
This enables or disables killing the OOM-triggering task in out-of-memory (oom) situations. If this is set to zero, or disabled, the OOM killer will scan through the entire task list and select a task based on heuristics to kill. This normally selects a rogue memory-hogging task that frees up a large amount of memory when killed. If this is set to non-zero, or enabled, the OOM killer simply kills the task that triggered the out-of-memory condition. This avoids the expensive task list scan, which can take mass amounts of time and "hang" or freeze the system.
block_dump (vm.block_dump)
This enables block I/O debugging when set to a nonzero value. If you want to find out which process caused the disk to spin up (see /proc/sys/vm/laptop_mode), you can gather information by setting the flag.
When this flag is set, Linux reports all disk read and write operations that take place, and all block dirtyings done to files. This makes it possible to debug why a disk needs to spin up, and to increase battery life even more. The output of block_dump is written to the kernel output, and it can be retrieved using "dmesg". When you use block_dump and your kernel logging level also includes kernel debugging messages, you probably want to turn off klogd, otherwise the output of block_dump will be logged, causing disk activity that is not normally there.
overcommit_memory (vm.overcommit_memory)
This controls overcommit of system memory, possibly allowing processes to allocate (but not use) more memory than is actually available.
0 - Heuristic overcommit handling. Obvious overcommits of address space are refused. Used for a typical system. It ensures a seriously wild allocation fails while allowing overcommit to reduce swap usage. root is allowed to allocate slighly more memory in this mode. This is the default.
1 - Always overcommit. Appropriate for some scientific applications.
2 - Don't overcommit. The total address space commit for the system is not permitted to exceed swap plus a configurable percentage (default is 50) of physical RAM. Depending on the percentage you use, in most situations this means a process will not be killed while attempting to use already-allocated memory but will receive errors on memory allocation as appropriate.
page-cluster (vm.page-cluster)
This controls the number of pages which are written to swap in a single attempt. The swap I/O size.
It is a logarithmic value - setting it to zero means "1 page", setting it to 1 means "2 pages", setting it to 2 means "4 pages", etc.
The default value is three (eight pages at a time). There may be some small benefits in tuning this to a different value if your workload is swap-intensive.
panic_on_oom (vm.panic_on_oom)
This enables or disables panic on out-of-memory feature. If this is set to 1, the kernel panics when out-of-memory happens. If this is set to 0, the kernel will kill some rogue process, by calling oom_kill().
Usually, oom_killer can kill rogue processes and system will survive. If you want to panic the system rather than killing rogue processes, set this to 1.
The default value is 0.
Panic is a system error that is detected by the kernel.
dirty_expire_centisecs (vm.dirty_expire_centisecs)
How old "dirty" data should be before the kernel considers it old enough to be written to disk. It is expressed in 100ths of a second.
dirty_writeback_centisecs (vm.dirty_writeback_centisecs)
This is the interval of when the writeback daemons periodically wake up and write "old" data out to disk. It is expressed in 100ths of a second.
I would be stoked if someone made a flashable zip for me to try
Sent from my ADR6300 using XDA
Could you please explain how this will increase battery life? And if it can be used in other phones?
Sent from my ADR6425LVW using XDA
Does this work on x10 mini with miniCM by NAa ?
I have sysctrl.conf file and when open it with rootexplorer its empty .
Can I add this lines from phone ? Copy/paste them into the files whith rootex ?
Pls answer me and thk U .
Sent from my E10i using xda premium
how do we know if our rom has init.d support?
do we have to ask the rom creator or is there a way to check
Is this already included in your Clutch Rom as well?
Sent from my HTC Droid Incredible using XDA
OMG_VTEC said:
how do we know if our rom has init.d support?
do we have to ask the rom creator or is there a way to check
Click to expand...
Click to collapse
You should have a line in /init.rc with busybox run-parts. To check the easiest way may be from the terminal:
Code:
grep busybox /init.rc
and look for a line like this:
Code:
service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
graymonkey44 said:
Could you please explain how this will increase battery life? And if it can be used in other phones?
Sent from my ADR6425LVW using XDA
Click to expand...
Click to collapse
Trust me it works, I had over 20+ hours at a semi heavy use.
Sent from my ADR6300 using Tapatalk 2
withbloodskies said:
Trust me it works, I had over 20+ hours at a semi heavy use.
Click to expand...
Click to collapse
Was there any system performance degradation and/or instability?
Would someone knowledgeable be willing to give an overview description as to what the proposed changes effect?
Would also like to know if this could be done from phone.
PureMotive said:
Okay guys, I just thought I'd give you my mod for achieving good-great battery life. This is the mod I use in Anthem™ which has given me 50+ hours on a single charge. Feel free to include it in your own ROM or whatever. Giving credit would be nice
Step 1
Open up your ROM.zip (or whatever it's called) in 7zip (Windows) or Betterzip (OSX) and locate
sysctl.conf in /system/etc
If it's not in this directory, create it.
Step 2
In your sysctl.conf file, post the following code and save it.
Code:
#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.panic=5;
kernel.sched_compat_yield=1;
kernel.panic=0;
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;
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;
net.ipv4.tcp_congestion_control=cubic;
net.ipv4.tcp_syncookies=1;
net.ipv4.conf.all.rp_filter=1;
net.ipv4.conf.default.rp_filter=1;
net.ipv4.tcp_synack_retries=2;
net.ipv4.tcp_syn_retries=2;
net.ipv4.tcp_max_syn_backlog=1024;
net.ipv4.tcp_max_tw_buckets=16384;
net.ipv4.icmp_echo_ignore_all=1;
net.ipv4.icmp_ignore_bogus_error_responses=1;
net.ipv4.tcp_no_metrics_save=1;
net.ipv4.tcp_fin_timeout=15;
net.ipv4.tcp_keepalive_intvl=30;
net.ipv4.tcp_keepalive_probes=5;
net.ipv4.tcp_keepalive_time=1800;
net.ipv4.ip_forward=0;
net.ipv4.conf.default.accept_source_route=0 ;
net.ipv4.conf.all.accept_source_route=0;
net.ipv4.conf.all.accept_redirects=0;
net.ipv4.conf.default.accept_redirects=0;
net.ipv4.conf.all.secure_redirects=0;
net.ipv4.conf.default.secure_redirects=0;
net.ipv4.udp_rmem_min=6144;
net.ipv4.udp_wmem_min=6144;
net.ipv4.tcp_rfc1337=1;
net.ipv4.ip_no_pmtu_disc=0;
net.ipv4.tcp_ecn=0;
net.ipv4.route.flush=1;
net.ipv4.tcp_rmem='6144 87380 524288';
net.ipv4.tcp_wmem='6144 87380 524288';
net.ipv6.conf.default.use_tempaddr=2;
net.ipv6.conf.all.use_tempaddr=2;
net.ipv6.conf.all.temp_prefered_lft=3600;
net.ipv6.conf.default.temp_prefered_lft=3600;
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;
Step 3
Now we need to enable it. So, navigate to /system/etc/init.d and create a file with the following code:
Code:
#!/system/bin/sh
# grep sysctl /etc/init.d/*
/etc/init.d/02vm:# Load /sys/etc/sysctl.conf
/etc/init.d/02vm:sysctl -p
sysctl -p is what initializes the code.
Name your file something like this 10sysctl
Save your file.
NOTE: Your ROM must support init.d. You can do this by using dsixda's android kitchen
Step 4
Save your ROM and install it via recovery
OR
you could just push the files into your current ROM and try them out.
Click to expand...
Click to collapse
Would this work on my HTC Inspire 4g?
Sent from my HTC Inpsire 4G using XDA
Would this work on my HTC Inspire 4G?
Sent from my Desire HD using XDA
I will try this method, as do the necessary tests will comment if it works or not, Greetings!
Does this code change things like how often you're phone checks the cell tower? Have you experienced any missed calls if this is the case? 50+ hours of battery life sounds like it'd be worth the risk, just curious as to what this script is actually doing.
Sent from my ADR6300 using XDA
ferotakis said:
Does this work on x10 mini with miniCM by NAa ?
I have sysctrl.conf file and when open it with rootexplorer its empty .
Can I add this lines from phone ? Copy/paste them into the files whith rootex ?
Pls answer me and thk U .
Sent from my E10i using xda premium
Click to expand...
Click to collapse
Yeah you should be able to paste it with rootex and get it working.
david.degraw54 said:
Would this work on my HTC Inspire 4G?
Sent from my Desire HD using XDA
Click to expand...
Click to collapse
Yes it should. It works with mine lol
jprow507 said:
Is this already included in your Clutch Rom as well?
Sent from my HTC Droid Incredible using XDA
Click to expand...
Click to collapse
Yep
ChuckFarley said:
Does this code change things like how often you're phone checks the cell tower? Have you experienced any missed calls if this is the case? 50+ hours of battery life sounds like it'd be worth the risk, just curious as to what this script is actually doing.
Sent from my ADR6300 using XDA
Click to expand...
Click to collapse
Nope, no missed calls. Everything works fine after using this script. Basically, if you use this, you're just getting the same or similar battery life and performance experience of Anthem on different ROMs.
Can someone please explain what this exactly does to improve battery life?
Sent from my ADR6425LVW using XDA
graymonkey44 said:
Can someone please explain what this exactly does to improve battery life?
Sent from my ADR6425LVW using XDA
Click to expand...
Click to collapse
Yes please answer this.
And can someone make this into a flashable .zip?
PureMotive said:
Nope, no missed calls. Everything works fine after using this script. Basically, if you use this, you're just getting the same or similar battery life and performance experience of Anthem on different ROMs.
Click to expand...
Click to collapse
Wow, sounds too good to be true. I'm all in!
Sent from my ADR6300 using XDA
I'll update the OP later with an explanation.
Quick question about adding the code to the sysctl.conf file: Do you completely replace the existing code with your suggested code, or append yours to the existing?
Guys, I need a help. Tried everything, but still facing big lag especially when I click on dialer, contacts or messages (waiting couple of secs until they show up). This is more obvious when I click right after I 'woke up' my phone from deep sleep.
I'm using stock 20b with Iodak v8 kernel (tried v9 as well, but due to bluetooth and fm radio issue on stock, reverted to v8). Also, I did everything what I could found to improve performace: disabled and then deleted MLT, did a full wipe of everything (clean install), installed only apps that I need, turned off 3g, data and gps (only WiFi is on), installed Greenify and so on..
My current setup of kernel is following:
Governor: interactive (tried ondemand, but was even worst)
Max: 1600000
Min/Max Screen Off: 760000
Scheduler: SIO
CPUQuiet Power: userspace (noticed that only 3 cores are online instead of 4)
I appreciate any help, but please, don't tell me to search, 'cause I did. As for the other custom roms, I tried CM, but I prefer more stock, mostly because of Gallery, Polaris and FM Radio Apps.
Guys, is there any way to fix this lag issue? I don't care much for the battery, since this lag drives me crazy.
Thanks in advance.
Vladimir
vladja10 said:
Guys, I need a help. Tried everything, but still facing big lag especially when I click on dialer, contacts or messages (waiting couple of secs until they show up). This is more obvious when I click right after I 'woke up' my phone from deep sleep.
I'm using stock 20b with Iodak v8 kernel (tried v9 as well, but due to bluetooth and fm radio issue on stock, reverted to v8). Also, I did everything what I could found to improve performace: disabled and then deleted MLT, did a full wipe of everything (clean install), installed only apps that I need, turned off 3g, data and gps (only WiFi is on), installed Greenify and so on..
My current setup of kernel is following:
Governor: interactive (tried ondemand, but was even worst)
Max: 1600000
Min/Max Screen Off: 760000
Scheduler: SIO
CPUQuiet Power: userspace (noticed that only 3 cores are online instead of 4)
I appreciate any help, but please, don't tell me to search, 'cause I did. As for the other custom roms, I tried CM, but I prefer more stock, mostly because of Gallery, Polaris and FM Radio Apps.
Guys, is there any way to fix this lag issue? I don't care much for the battery, since this lag drives me crazy.
Thanks in advance.
Vladimir
Click to expand...
Click to collapse
This is "normal" for system apps. Download custom apps from google store like ExDialer,GOSms.. That will resolve your lag.. When you install those apps from store, use titanium backup to freeze stock apps(dialer,contacts,messages).
@vladja10 http://forum.xda-developers.com/showpost.php?p=49272503&postcount=1986
Thanks guys, but neither of these two options helped. There's some improvements, but still pretty much laggy.
Think I found out what causing lag: synchronization. Every time when phone is synchronizing, everything is so laggy, otherwise is ok. Following accounts have sync turned on: Skype, Facebook, WhatsApp, Twitter and Google.
Does anyone of you have experienced similar problem? Is there solution for this?
vladja10 said:
Think I found out what causing lag: synchronization. Every time when phone is synchronizing, everything is so laggy, otherwise is ok. Following accounts have sync turned on: Skype, Facebook, WhatsApp, Twitter and Google.
Does anyone of you have experienced similar problem? Is there solution for this?
Click to expand...
Click to collapse
I have all those apps running in my phone, but I did not face those lags.
But ya I did felt those lags when I'm still using stock JB OS. Stock JB from LG is sucks man, you should instal another ROM.
Currently I'm using CM11 (Kitkat 4.4.2 based), its lag free and have more free RAM. (around 350 - 400MB). :good:
The difference is like heaven and hell compared with the stock ROM (I only have 150 - 200MB Free RAM).
bomerzz said:
I have all those apps running in my phone, but I did not face those lags.
But ya I did felt those lags when I'm still using stock JB OS. Stock JB from LG is sucks man, you should instal another ROM.
Currently I'm using CM11 (Kitkat 4.4.2 based), its lag free and have more free RAM. (around 350 - 400MB). :good:
The difference is like heaven and hell compared with the stock ROM (I only have 150 - 200MB Free RAM).
Click to expand...
Click to collapse
The ROM can make a difference, but it has nothing to do with "Free RAM". I wish people would stop perpetuating this myth.
Free RAM is wasted memory on an Android device. Unless you are getting below about 50MB there is not a problem as the device is designed to use as much as it can and then swap it out automatically.
I agree about CM11 though. I'm running the latest nightly and the only problem I have is the delay in waking when you press the power button
SimonTS said:
The ROM can make a difference, but it has nothing to do with "Free RAM". I wish people would stop perpetuating this myth.
Free RAM is wasted memory on an Android device. Unless you are getting below about 50MB there is not a problem as the device is designed to use as much as it can and then swap it out automatically.
I agree about CM11 though. I'm running the latest nightly and the only problem I have is the delay in waking when you press the power button
Click to expand...
Click to collapse
Well.. Sorry for my false statement and thank you for correcting it
4X HD is my very first android device. But that's what I really thought after I flashed the CM11.. Its like whoa, more free space on RAM, and it feels like I'm using a new phone
bomerzz said:
Well.. Sorry for my false statement and thank you for correcting it
4X HD is my very first android device. But that's what I really thought after I flashed the CM11.. Its like whoa, more free space on RAM, and it feels like I'm using a new phone
Click to expand...
Click to collapse
You might want a read of this;-
RAM: What it is, how it's used, and why you shouldn't care
Well, I’m afraid that I’ll be forced to get back to CM (used it once, but missed some apps such are: FM Radio, stock gallery app (couldn’t find good replacement that synced photos with google acc) and Polaris Office – these apps I use on a daily basis). Anyway, before install CM, I’ll give one more try to Stock.
I did what @ottomanhero told me, and that actually helped. But, since I used Trickstermod to tweak governors, after every single reboot, stock values would be back, so I had to use init.d script, and there comes a problem.
Here is what I did (followed instructions from Iodak's OP):
- Using ES File Explorer created folder /system/etc/init.d and set permissions to rwxr-xr-x
- Created new file in init.d folder and name it 1script (used Note++ instead of Windows editors to avoid leaving an extra space at the end of each line or an invisible invalid character)
- Then added following commands:
Code:
#!/system/bin/sh
echo "70" > /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load
echo "70" > /sys/devices/system/cpu/cpufreq/interactive/midrange_go_maxspeed_load
echo "60000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 200 300 400 450 500 600 > /sys/devices/system/cpu/cpu0/cpufreq/gpu_overclock
- and finally set permissions to 1script rwxr-xr-x and owner to root group to shell
So, that should be it, but didn’t work for me. Then, I installed SManager to check what’s wrong with the script, and it stated that with first 4 lines error is: no such file or directory (which is strange because exactly that's the path), and for the last line is stated: permission denied.
Did I miss something? Apologize if this question is too noob for you guys, but I’m running out of ideas.
Thanks all for your help.
Regards,
Vladimir
SimonTS said:
You might want a read of this;-
RAM: What it is, how it's used, and why you shouldn't care
Click to expand...
Click to collapse
Oh, really?
Free RAM is NOT wasted RAM.
It directly effects smoothness of the phone.Why do you think android would have Out Of Memory values if it was created to just fill up the RAM with only apps? It still needs some RAM free for caching.
---------- Post added at 03:50 PM ---------- Previous post was at 03:46 PM ----------
vladja10 said:
Well, I’m afraid that I’ll be forced to get back to CM (used it once, but missed some apps such are: FM Radio, stock gallery app (couldn’t find good replacement that synced photos with google acc) and Polaris Office – these apps I use on a daily basis). Anyway, before install CM, I’ll give one more try to Stock.
I did what @ottomanhero told me, and that actually helped. But, since I used Trickstermod to tweak governors, after every single reboot, stock values would be back, so I had to use init.d script, and there comes a problem.
- and finally set permissions to 1script rwxr-xr-x and owner to root group to shell
So, that should be it, but didn’t work for me. Then, I installed SManager to check what’s wrong with the script, and it stated that with first 4 lines error is: no such file or directory (which is strange because exactly that's the path), and for the last line is stated: permission denied.
Did I miss something? Apologize if this question is too noob for you guys, but I’m running out of ideas.
Thanks all for your help.
Regards,
Vladimir
Click to expand...
Click to collapse
Code:
#!/system/bin/sh
echo "70" > /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load
echo "70" > /sys/devices/system/cpu/cpufreq/interactive/midrange_go_maxspeed_load
echo "60000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo "200 300 400 450 500 600" > /sys/devices/system/cpu/cpu0/cpufreq/gpu_overclock
I think the script didn't execute at boot due to last line, you forgot the quotes.And while using Smanager you gotta tick "root" or else it won't run.Try this one
ottomanhero said:
I think the script didn't execute at boot due to last line, you forgot the quotes.And while using Smanager you gotta tick "root" or else it won't run.Try this one
Click to expand...
Click to collapse
Well, you were right about the quotes (now, the new values are set), but as the other 4 lines, they still have the same error: No such file or directory, and all values are stock.
Do you have any idea what's going on? Why did it work for one, and didn't for the other lines?
http://forum.xda-developers.com/showthread.php?p=48042187#post48042187
ottomanhero said:
Oh, really?
Free RAM is NOT wasted RAM.
It directly effects smoothness of the phone.Why do you think android would have Out Of Memory values if it was created to just fill up the RAM with only apps? It still needs some RAM free for caching.
Click to expand...
Click to collapse
As I stated in my first post;-
Unless you are getting below about 50MB there is not a problem
Click to expand...
Click to collapse
Of course you need some free memory, but not hundreds of MBs of it. I notice that you pointed the same XDA quote that is used and linked to by lots of different sites when this is being discussed. To use someone else's quote - better written than I could do so myself;-
In the most simplistic terms, here is how it works, and why "free RAM is wasted RAM," but also, why you don't want all RAM in use at any given time.
If an application is not in memory when you try to open it, that application haa to be loaded into memory, thus triggering a "load time." Having the application in memory (prefetched) prevents this load time and has the application load near insantly. This is why a modern OS will preload our most commonly used applications into memory. The more memory that you have, the more applications that can be preloaded, the smoother your device will run. Clearing this memory gives you no immeidate benefit, and will actually slow your device. Idle applications in memory consume almost no resources (CPU cycles, battery power, etc.). If an application is consuming resources, that means that it is doing something. Closing it will only force the application to re-load. Using a task killer for this purpose will cause a "boxing match" where the task killer closes the application, the app reopens itself, and back and forth. THIS will consume resources.
However, you want to have some memory free. Your devices will not have enough memory to preload EVERY application, so it has to guess based on your actions. It needs to have enough memory available to quickly load an app that you may want.
Let's say that you want to load an application that requires 256MB of RAM, but you only have 128MB available. This means that the OS is going to try to clear 128MB of RAM to accomodate your app, and as your app loads, will try to clear another 128MB to return to its previous state. This clear/load/clear causes a longer load time and more slowdown than just loading an app not already in memory.
So, the ideal situation is to have most common apps in memory (pre-fetched), but enough memory available to handle 1-2 common apps that are not already pre-loaded. Touchwiz (Samsung) devices allow you to clear memory from the task manager. My S2 had about 870MB of user-available RAM, and if I trashed all apps, it would go as low as 300MB in use. This may look cool, but it is a complete waste of resources, and the OS is simply going to re-load those apps over the next 2-3 minutes anyway. And if you use a task killer to keep your device idling at 300MB of available RAM? This is simply going to slow down the device, harm the battery, and give you the same memory performance and availability that you would get with an HTC G1.
Click to expand...
Click to collapse
As the OP was stating that "I only have 150 - 200MB Free RAM" with the Stock ROM, that is definitely NOT what is causing a lag issue. If you have that much free memory (before Android goes caching stuff and not declaring it of course) then you are absolutely fine on any Android device there is.
vladja10 said:
Well, you were right about the quotes (now, the new values are set), but as the other 4 lines, they still have the same error: No such file or directory, and all values are stock.
Do you have any idea what's going on? Why did it work for one, and didn't for the other lines?
Click to expand...
Click to collapse
Maybe your partitions aren't mounted.I took these lines from pimp my rom init.d script.Create another script but it has to come before the governor tweaks script.
#!/system/bin/sh
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,barrier =0,nobh /system
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodir atime,barrier=0,nobh /data
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodir atime,barrier=0,nobh /cache
Click to expand...
Click to collapse
For example, name this script "93Mount" and name the governor script "94Governor" so the mounting script will be executed before governor script.
ottomanhero said:
Maybe your partitions aren't mounted.I took these lines from pimp my rom init.d script.Create another script but it has to come before the governor tweaks script.
For example, name this script "93Mount" and name the governor script "94Governor" so the mounting script will be executed before governor script.
Click to expand...
Click to collapse
Well, I did like you said and here's what I got:
Code:
exec /system/bin/sh '/etc/init.d/93Mount'
h '/etc/init.d/93Mount' <
failed: No such file or directory
failed: No such file or directorybh on /data
mount: mounting atime,barrier=0,nobh on /cache failed: Invalid argument
Any idea?
For the People who want Stock Gallery on CM and hate Aosp Gallery like Iam, check facebook offical cyanogenmod. They send a link to their new gallery next. Its in beta stase, so its not avaible yet. But if its stable itll be in play store. Its like the stock gallery app. Very beauty
Sent from my LG-P880 using xda app-developers app
vladja10 said:
Well, I did like you said and here's what I got:
Code:
exec /system/bin/sh '/etc/init.d/93Mount'
h '/etc/init.d/93Mount' <
failed: No such file or directory
failed: No such file or directorybh on /data
mount: mounting atime,barrier=0,nobh on /cache failed: Invalid argument
Any idea?
Click to expand...
Click to collapse
Well try this app https://play.google.com/store/apps/details?id=com.stericson.remount&hl=tr
EDIT : check this link out. http://forum.xda-developers.com/showthread.php?t=1381188
I'm not sure it's the right track or not, it does happen to me quite ago.
The problem is the SD (my case, luckily it's external). The system try to read files from card but it got error thus try again => laggy
I removed the card and it's alive. Try to check your internal sd. hope that help
App didn't help, I got the same error. Never mind, I give up Will use Trickstermod after every single reboot until finally find solution. Thanks @ottomanhero for all your help.
@GalaxyVolvoZ that app looks realy nice. Finally a good replacement for Stock Gallery.
@klbterminator I don't have any problems with SD, at least didn't so far
Thanks guys.
Regards,
Vladimir
IMPORTANT: I think i reach the final build for this script. All in all i present two version of the script. One codename Balanced that is the initial script (and there for is the most balances i've got) and another codename Ultra Smooth as it is very smooth but may be too aggressive on background secondary services.
Balanced:
#!/system/bin/sh
echo "8192,16384,24064,32768,49152,65536" > /sys/module/lowmemorykiller/parameters/minfree
Empty Apps: 256mb
Content Providers: 192mb
Hidden Apps: 128mb
Secondary Server: 94mb
Visible Apps: 64mb
Foreground Apps: 32mb
https://mega.nz/#!NoJEXIiI!NXTetoxuwBMBzxsUCVIcrvEB_jxUSp3sE1z5e6VQIkc
Click to expand...
Click to collapse
Ultra Smooth:
#!/system/bin/sh
echo "9472,13824,19968,44544,58368,65536" > /sys/module/lowmemorykiller/parameters/minfree
Empty Apps: 256mb
Content Providers: 228mb
Hidden Apps: 174mb
Secondary Server: 78mb
Visible Apps: 54mb
Foreground Apps: 37mb
https://mega.nz/#!N4IiSboa!v4tSk1X_RZeGBJesrJbJUpJZvcdMiN2rTE4loTWHsYI
Click to expand...
Click to collapse
Hello, for all the Moto G users who have the crDroid ROM and have tried the Pink Kernel, i've made this topic so we can try to find the root from the performance issues with the combination of said ROM and Kernel.
For who follow my last post on both the thread of the ROM and Kernel, i had a theory about what was the issue.
After read the experience other users had with it and my own i came to the conclusion that the stability issue, force stop from heavy apps and even small reboots ("BSOD") came from a very different philosophy on the OOM (Out of Memory) configurations of the ROM stock Kernel (that don't have this issues) vs the Pink Kernel on this ROM.
With the Stock, i realize that we have much more free RAM (i got from 400mb free to 240mb free) then on Pink Kernel (that i was ranging from 280mb free to 144mb free). That is a big difference.
Our devices are amazing phones, but it RAM amount isn't the best now days, so i figured that heavy Apps (such as the Facebook one, the one who most had issues with the ROM+Kernel) just don't have much free RAM from the pool. So it hit the page file/swap (there for cause a very laggy experience and force closes) and if the page file/swap don't do the cut it reboot the phone.
On the stock kernel as it give much more free RAM it didn't had any of those issues (even though on my experience the Facebook App never run as smooth as the other apps, even on the stock kernel). So i tried my first attempt to remedy this issue.
As my Kernel management app of choice don't apply OOM settings after reboot (it go back to the stock one of the Kernel we have), and i like it as if it go wrong on boot it is ok again, i've made a simple script, so on every reboot it apply my settings and too that is a simple way that who don't use Kernel management apps can have this "fix".
I also don't like to use INIT.D for this as if it go wrong it will bootloop. With SManager (a free app on the play store) it is very safe if go wrong and if not.. it work just as INID.D in this case.
To who don't know how to use SManager, just get it on the play store. After open the app click on the menu button and choose new program. It will ask you to give a name, you can choose any one you like (i've choose OOM-FIX).
After give the name open it from the list within the app and click (to enable) the SU and BOOT option. After it click on the edit button so you can write the script.
On the script editor, here is the code of the script:
#!/system/bin/sh
echo "9472,13824,19968,44544,58368,65536" > /sys/module/lowmemorykiller/parameters/minfree
Click to expand...
Click to collapse
Now save everything and either run it or reboot.
If you do use a Kernel Management app who apply OOM custom settings on each reboot, this settings on the script represent:
Empty Apps: 256mb
Content Providers: 228mb
Hidden Apps: 174mb
Secondary Server: 78mb
Visible Apps: 54mb
Foreground Apps: 37mb
Click to expand...
Click to collapse
This was the best middle ground i found from the Pinky Kernel OOM vs the Stock (with my settings i'm getting from 386mb free to 244mb free).
I only tester for two days so far, but my experience on Facebook (the app who most gave me trouble) was very satisfactory. It isn't 100% perfect but for my use it is a good 85% (must remember that even on the stock kernel it wasn't 100% good).
The app don't lag as much, only if we spam commands such as click on the back button more then once at the same time it lag more then acceptable. But scroll down on the timeline, messages and person profile was very good.
Open too many pages inside the app lag a little too but nothing close to force boot or even force close the app for me.
But i'm not the most heavy FB user, neither the most heavy Phone user.
That is where you guys come in. If you guys who use the amazing crDroid ROM and love the Pink Kernel want to keep this combination, try this script/OOM settings i just shared, so if it need more tweaks (and if it really is the cause of the issue) we can do it. As for my use it is fine, but i want to know about on other phones and users/uses.
Just to share the full spec and config of my phone, it is a Moto G 4G LTE XT1040 using the latest crDroid with the latest Pink Kernel. I am not a heavy user and my GAPPS is the minimum pack. I greenify almost all apps on the phone (including many system ones), i have a big wakelock setting to not allow apps to wakelock and all in all i do the best to only let the apps i want to run (and usually are the foreground ones i've choose to use).
How ever i do use also Xposed and a lot of custom tweaks.
My Pink Kernel configuration (With 3C Toolbox) is a CPU profile that i'll share:
Profile:
Intelliactive @ min:300mhz and max 1,18ghz
All cores setup as free
TCP/IP Algorithm: Veno
SD Cache: 512
I/O: ROW
Double tap to wake: On
When the screen is off i have a userspace profile locked at 300mhz min and max frequency.
So there you go, who want to use the ROM and Kernel try this script or OOM out (you can try a Tune for profiles like mine too in case to emulate what my phone got as a result) and post the results, if it got better, worse or if it fix.
For me the phone is very present to use, VERY smooth and the Facebook App is manageable now.
NEW: INIT.D script Download:
https://mega.nz/#!N4IiSboa!v4tSk1X_RZeGBJesrJbJUpJZvcdMiN2rTE4loTWHsYI
(please do a NanoBackup before apply it, for test if it work open the terminal and type: cat /sys/module/lowmemorykiller/parameters/minfree).
Click to expand...
Click to collapse
CHANGELOG:
v0.1:
#!/system/bin/sh
echo "8192,16384,24064,32768,49152,65536" > /sys/module/lowmemorykiller/parameters/minfree
Empty Apps: 256mb
Content Providers: 192mb
Hidden Apps: 128mb
Secondary Server: 94mb
Visible Apps: 64mb
Foreground Apps: 32mb
Click to expand...
Click to collapse
v0.2:
#!/system/bin/sh
echo "13312,17664,19968,37120,53248,65536" > /sys/module/lowmemorykiller/parameters/minfree
Empty Apps: 256mb
Content Providers: 208mb
Hidden Apps: 145mb
Secondary Server: 78mb
Visible Apps: 69mb
Foreground Apps: 52mb
Click to expand...
Click to collapse
v1.0:
#!/system/bin/sh
echo "8191,12544,19968,37120,53248,65536" > /sys/module/lowmemorykiller/parameters
Empty Apps: 256mb
Content Providers: 208mb
Hidden Apps: 145mb
Secondary Server: 78mb
Visible Apps: 49mb
Foreground Apps: 32mb
Click to expand...
Click to collapse
v2.0a-Codename-Balanced:
#!/system/bin/sh
echo "8192,16384,24064,32768,49152,65536" > /sys/module/lowmemorykiller/parameters/minfree
Empty Apps: 256mb
Content Providers: 192mb
Hidden Apps: 128mb
Secondary Server: 94mb
Visible Apps: 64mb
Foreground Apps: 32mb
Click to expand...
Click to collapse
v2.0b-Codename-Ultra_Smooth:
#!/system/bin/sh
echo "9472,13824,19968,44544,58368,65536" > /sys/module/lowmemorykiller/parameters/minfree
Empty Apps: 256mb
Content Providers: 228mb
Hidden Apps: 174mb
Secondary Server: 78mb
Visible Apps: 54mb
Foreground Apps: 37mb
Click to expand...
Click to collapse
Pupet_Master said:
Hello, for all the Moto G users who have the crDroid ROM and have tried the Pink Kernel, i've made this topic so we can try to find the root from the performance issues with the combination of said ROM and Kernel.
For who follow my last post on both the thread of the ROM and Kernel, i had a theory about what was the issue.
After read the experience other users had with it and my own i came to the conclusion that the stability issue, force stop from heavy apps and even small reboots ("BSOD") came from a very different philosophy on the OOM (Out of Memory) configurations of the ROM stock Kernel (that don't have this issues) vs the Pink Kernel on this ROM.
With the Stock, i realize that we have much more free RAM (i got from 400mb free to 240mb free) then on Pink Kernel (that i was ranging from 280mb free to 144mb free). That is a big difference.
Our devices are amazing phones, but it RAM amount isn't the best now days, so i figured that heavy Apps (such as the Facebook one, the one who most had issues with the ROM+Kernel) just don't have much free RAM from the pool. So it hit the page file/swap (there for cause a very laggy experience and force closes) and if the page file/swap don't do the cut it reboot the phone.
On the stock kernel as it give much more free RAM it didn't had any of those issues (even though on my experience the Facebook App never run as smooth as the other apps, even on the stock kernel). So i tried my first attempt to remedy this issue.
As my Kernel management app of choice don't apply OOM settings after reboot (it go back to the stock one of the Kernel we have), and i like it as if it go wrong on boot it is ok again, i've made a simple script, so on every reboot it apply my settings and too that is a simple way that who don't use Kernel management apps can have this "fix".
I also don't like to use INIT.D for this as if it go wrong it will bootloop. With SManager (a free app on the play store) it is very safe if go wrong and if not.. it work just as INID.D in this case.
To who don't know how to use SManager, just get it on the play store. After open the app click on the menu button and choose new program. It will ask you to give a name, you can choose any one you like (i've choose OOM-FIX).
After give the name open it from the list within the app and click (to enable) the SU and BOOT option. After it click on the edit button so you can write the script.
On the script editor, here is the code of the script:
#!/system/bin/sh
echo "8192,16384,24064,32768,49152,65536" > /sys/module/lowmemorykiller/parameters/minfree
Now save everything and either run it or reboot.
If you do use a Kernel Management app who apply OOM custom settings on each reboot, this settings on the script represent:
Empty Apps: 256mb
Content Providers: 192mb
Hidden Apps: 128mb
Secondary Server: 94mb
Visible Apps: 64mb
Foreground Apps: 32mb
This was the best middle ground i found from the Pinky Kernel OOM vs the Stock (with my settings i'm getting from 386mb free to 244mb free).
I only tester for two days so far, but my experience on Facebook (the app who most gave me trouble) was very satisfactory. It isn't 100% perfect but for my use it is a good 85% (must remember that even on the stock kernel it wasn't 100% good).
The app don't lag as much, only if we spam commands such as click on the back button more then once at the same time it lag more then acceptable. But scroll down on the timeline, messages and person profile was very good.
Open too many pages inside the app lag a little too but nothing close to force boot or even force close the app for me.
But i'm not the most heavy FB user, neither the most heavy Phone user.
That is where you guys come in. If you guys who use the amazing crDroid ROM and love the Pink Kernel want to keep this combination, try this script/OOM settings i just shared, so if it need more tweaks (and if it really is the cause of the issue) we can do it. As for my use it is fine, but i want to know about on other phones and users/uses.
Just to share the full spec and config of my phone, it is a Moto G 4G LTE XT1040 using the latest crDroid with the latest Pink Kernel. I am not a heavy user and my GAPPS is the minimum pack. I greenify almost all apps on the phone (including many system ones), i have a big wakelock setting to not allow apps to wakelock and all in all i do the best to only let the apps i want to run (and usually are the foreground ones i've choose to use).
How ever i do use also Xposed and a lot of custom tweaks.
My Pink Kernel configuration (With 3C Toolbox) is a CPU profile that i'll share:
Profile:
Intelliactive @ min:300mhz and max 1,18ghz
All cores setup as free
TCP/IP Algorithm: Veno
SD Cache: 512
I/O: ROW
Double tap to wake: On
When the screen is off i have a userspace profile locked at 300mhz min and max frequency.
So there you go, who want to use the ROM and Kernel try this script or OOM out (you can try a Tune for profiles like mine too in case to emulate what my phone got as a result) and post the results, if it got better, worse or if it fix.
For me the phone is very present to use, VERY smooth and the Facebook App is manageable now.
Click to expand...
Click to collapse
You did an amazing job! Yesterday when I tried the kernel everything was softrebooting, now the phone is smooth as butter! First time we got pink kernel working on a ROM! Have my thanks
Sparubens said:
You did an amazing job! Yesterday when I tried the kernel everything was softrebooting, now the phone is smooth as butter! First time we got pink kernel working on a ROM! Have my thanks
Click to expand...
Click to collapse
Thanks m8, anything you don't like feel free to tell and we tune it even more
New setup/tune.
I think this will be final, check out the new values and test
Final build release.