A lot of people have a tough time with Hero/Sense ROMs. I thought I'd make a guide on what I do to help others out. This is not definitive but it's my personal way of doing things. Comments, tips and suggestions are welcome here. I will update this with some more info as I go along.
I have a MT3G but this is the same for G1.
**Firerat has really comprehensive guides for A2SD and other tweaks. Please check his thread for more info. Also, his post about setcpu profiles is a must read.
First, get a ROM. I'm currently playing with KingKlick's Legend Port and Vegaman's kernel update.zip. This guide applies to any Hero ROM though.
Table of Contents / Overview
First things first
Get your task killers in order (TasKiller, AutoKiller, etc.)
MyBackup Pro or similar if you use them
Autostarts-- one of my favorites. Would love to hear about a free alternative
Droidwall-- free, blocks Internet to apps you choose
Reboot, wipe Dalvik-cache, reboot
Additional steps, Misc, Errata
FIRST:
Partition your SD card. I set a 256MB swap partition and have copious memory left over even under heavy load. EXT2 is better than 3/4.
Flash the ROM, flash the kernel update after. Boot the ROM, go through set up. I always skip signing in at this point as the setup is heavy on the CPU and wait for things to settle before the memory intensive sign in process begins.
SECOND:
Okay, now I see the home screen. Install TasKiller (free/paid) with ADB, MyBackup Pro and kill all the processes except Sense. I highly recommend Autostarts (paid). It handles not only autostart processes but also event listeners and will significantly speed up the ROM. Here are the services I disable:
"After Startup"
Download Manager
My Uploads
Network Location
PC Synchronization
HTC Message Uploader
Peep
HTC Media Uploader
Flickr/FaceBook/MySpace/etc
com.htc.socialnetwork.provider
HTC Widget Download Manager
MyBackup Pro (Uploads your location to their servers at every boot!!)
"Connectivity Changed"
My Uploads
Network Location Service
HTC Message Uploader
HTC Media Uploader
com.htc.socialnetwork.provider
"Application Installed"
PC Synchronization
Pico TTS (why would text-to-speech need to run...)
If you use Slacker.. disable it completely from all "Application Changed/Installed/Removed" categories. No need in them knowing your usage..
"Screen Off"
TasKiller
Notice how (and you can watch with logcat) when an application is modified or installed, it starts up Pico TTS (text-to-speech), synchronization, etc. This is not necessary and a memory hog. You might also be thinking "but I needz muh Facebook" but you don't need it to autostart. These services will load on demand as you use them. Without them, things go a lot quicker.
THIRD: (If you use MyBackup Pro)
Now, I sign into my account with Market, accept the terms and conditions. Once things have settled and I'm able to use the Market I exit the app immediately. I use MyBackup Pro to restore my apps. Version 3 now links apps to Market so they can be updated. Pretty slick despite the fact it logs your location to their servers without your permission. Luckily Autostarts stopped that. Now there's a small catch-- MyBackup messes up the Market database. Easy fix with ADB:
Code:
# cd /data/data/com.android.vending/databases
# ls -l
[I]I summarized the output here for formatting's sake..[/I]
----rwxr-x assets.db
-rw-rw---- billing.db
-rw-rw---- webview.db
-rw-rw---- webviewCache.db
See how assets.db is owned by root and the wrong permissions? This will FC Market 10/10 times. So:
Code:
# cp assets.db BACKUPassets.db
# cp -p billing.db assets.db
# cat BACKUPassets.db | tee assets.db
# rm BACKUPassets.db
Now it will work. The theory is that we can't chown the DB due to an "unknown user" but the other files there have the correct permissions. We use cat and tee to overwrite the clone with the correct contents. It's a hack that works perfectly.
FOURTH:
I then reboot and go to the Market. Install Droidwall (free) and set it to blacklist any app that doesn't need Internet Access. I also install AdFree (free). One site that it doesn't block is flurry.com. This site is used by a lot of applications such as MoreLocale. It uploads personally identifying information about you including your location, phone number, account info, etc. without your permission. I append it to my hosts file afterward. Note that each update with AdFree will erase that entry but I use Autostarts to disable it at boot and never update.
Code:
# mount -o remount,rw /dev/block/mtdblock3 /system
# echo "127.0.0.1 flurry.com" | tee -a /system/etc/hosts
# mount -o remount,ro /dev/block/mtdblock3 /system
FIFTH:
With all the apps now installed that I want to start out with, I go back to Autostarts and disable those I don't want (pretty much all of them). I reboot into recovery mode and wipe Dalvik cache. Reboot, wait for it to cache again and all is well.
Additional Steps
You can easily lock home into memory. *thanks speedysilwady and firerat. Here's how to set this permanently:
Code:
adb pull /init.rc
[I]replace "setprop ro.HOME_APP_MEM ..." with:
[B]setprop ro.HOME_APP_MEM 1536[/B]
[/I]adb push init.rc /sdcard/init.rc
adb shell
# mount -o remount,ro rootfs /
# cat /sdcard/init.rc | tee /init.rc
# mount -o remount,rw rootfs /
# rm /sdcard/init.rc
I will update this as I go. Any comments and tricks like reducing call delays are welcome. Again, this is just how I do things. Hope it helps.
Reserved for the updates....
Reserved for more updates. Just in case.
Don't bother getting kings version just get Vegaman's 0.3 version.
It works a treat and fast as well...
EDIT= and on Vegaman's use EXT2 not EXT4 like you have to do in kings roms. EXT2 is faster then EXT4
Awesome thread! you could also use AutoKiller and Cachemate to keep things smooth as well! =]
Updated OP. I'm looking for the prioritizer script that supposedly gets incoming calls within 1-2 rings... will update when I get it figured out. I have between 40-55MB free memory according to TasKiller when no apps are running.
deuse said:
Don't bother getting kings version just get Vegaman's 0.3 version.
It works a treat and fast as well...
EDIT= and on Vegaman's use EXT2 not EXT4 like you have to do in kings roms. EXT2 is faster then EXT4
Click to expand...
Click to collapse
I agree...and great job thread creater!!!
Interesting! I will try this, how much will the speed increase be?
With what I do, I barely get any slow downs unless I run a lot of apps but I have TasKiller's mini taskbar on one of my home screens and always clear things out before I do something like web browsing, Maps, or games to keep RAM clean.
I'd love an alternative to Autostarts that's free but it is truly great. Blocking listeners causes a huge boost in speed. You will see in logcat when you install an app that all these services start running in the background like Voice Dialer, TTS, etc. That's the reason installing apps seems to peg the phone for a few minutes. Not so when you block those background services.
enatefox said:
Updated OP. I'm looking for the prioritizer script that supposedly gets incoming calls within 1-2 rings... will update when I get it figured out. I have between 40-55MB free memory according to TasKiller when no apps are running.
Click to expand...
Click to collapse
Code:
su
setprop ro.HOME_APP_MEM 1536
this will keep home in memory. I learned that one from Firerat , should make calls come in faster
from what i understand a large swap like that might offer some positive temporary results, but after time clogs up
adelco93 said:
from what i understand a large swap like that might offer some positive temporary results, but after time clogs up
Click to expand...
Click to collapse
It's bad to have a large swap and high swappiness.
I haven't had any issues. The swap partition hasn't clogged up or even gone under 100MB left for me yet. Your mileage may vary but it's what I set it to. What size/swappiness would you recommend then? 96MB is not enough, 128MB seemed like too close to the edge of what I need.
I need to make the OP not look like crap...
It is better for the life of your sdcard to have a large swap....because if you allocate say only 64mb to swap...those blocks on your sdcard are constantly being written/read and the rest isn't....better to have a swap of say 256mb so that you are evening out the stress on the blocks more.
I think Wes G or Chris S said this....but that's my paraphrase of it.
Also no difference in speed between a 32mb swap and a 256mb swap. Just depends on your sdcard's class.
enatefox said:
I haven't had any issues. The swap partition hasn't clogged up or even gone under 100MB left for me yet. Your mileage may vary but it's what I set it to. What size/swappiness would you recommend then? 96MB is not enough, 128MB seemed like too close to the edge of what I need.
I need to make the OP not look like crap...
Click to expand...
Click to collapse
60 at most 80 or 100 is to much
G1ForFun said:
Also no difference in speed between a 32mb swap and a 256mb swap. Just depends on your sdcard's class.
Click to expand...
Click to collapse
If we were talking about computers then swap would be same size as ram, it's better to have no swap at all then to have one
Read some of this:
https://help.ubuntu.com/community/SwapFaq
G1ForFun said:
It is better for the life of your sdcard to have a large swap....because if you allocate say only 64mb to swap...those blocks on your sdcard are constantly being written/read and the rest isn't....better to have a swap of say 256mb so that you are evening out the stress on the blocks more.
I think Wes G or Chris S said this....but that's my paraphrase of it.
Also no difference in speed between a 32mb swap and a 256mb swap. Just depends on your sdcard's class.
Click to expand...
Click to collapse
Try Fireat
But for purposes of speed, a large swap partition will get full eventually, and when it does, have fun trying to use your phone. It gets slower because swap has to "dig" through more files to get what you want, the more files it has to dig through, the slower it is. However, you won't notice this if you reboot often (and I guess 5% of Android users reboot daily)
is there a way to enable compache on any of these hero roms?
speedysilwady said:
is there a way to enable compache on any of these hero roms?
Click to expand...
Click to collapse
The user.conf (if it is activated on the rom)
JAguirre1231 said:
The user.conf (if it is activated on the rom)
Click to expand...
Click to collapse
The thing is im not sure if its activated in any of the newer sense roms, i never heard it mentioned, so i figured id ask. ill go check the user.conf...
speedysilwady said:
The thing is im not sure if its activated in any of the newer sense roms, i never heard it mentioned, so i figured id ask. ill go check the user.conf...
Click to expand...
Click to collapse
None of newer ones use it for a reason, you would use back-swapping instead(Cc+swap)
Related
I have task killer set to ignore two applications: Battery Widget and Weather Widget (donation version).
I've rooted my phone and am running Cyanogen 4.0.1 with Ted's hero theme. And I've formatted my SD to have FAT32, EXT3, and Linux Swap partitions and have my apps installed to my SD.
However, when I use taskiller to close all my applications I'm usually left with only 28 to 30 M free. Sometimes I'll only have 26 M or all the way up to 33 M left. Is this normal?
How much memory do you guys have left after you kill your tasks? Are my numbers low enough to make you think I've not partitioned my SD correctly or something else?
I feel like my phone should be much much faster than it was before I rooted it, but I don't see the huge improvements many people seem to.
Any help is appreciated.
yeah, I have questioned this too. I use Advanced Task Manager with 2 apps excluded. I usually am at 41 MB when all are ended. Prior to rooting this was in the 50's. I assume it is because the ROM has used some of this memory?
I also seem to have a lot less internal memory than others. I have 54MB when I go review my memory under settings. Not sure how others are in the 70-80 MB range. I clear cache frequently.
Also have 3 partitions 7.5GB/500MB/32MB
to the OP - have you deleted the cache of programs like browser, google maps?
I'm not sure how. I'd love to delete both of those and a few others (voice dialing I will never use you!!). I've gone into the apps manager but it won't let me uninstall them.
Yes, I'm a complete noob at this .
One thing I may have done wrong. I didn't reflash my cyanogen rom after formatting my SD. Could that be a problem?
Nagh, the rom would do it on the next reboot... go to menu... settings... sd card and phone storage. It should show all memory there (including second partition).
To delete cache, go to menu... settings... applications... app manager.
Click on browser, scroll down and delete cache. How much was there?
There wasn't much. It was like 1 to 1.5 megs, but it's gone now. I also set my gmail sync down to 1 day and cleared out it's data. Still though, my phone just feels like it's not getting the big speed upgrades others talk about.
I am hoping someone else will chime in on the low memory reported by task killer/manager in our cases.
How much internal memory were you showing under settings and removing cache?
You can sort the app manager by size too (of course the apps are on your sd card) but the cache is not.
I take it you confirmed your partitions were working?
They seem to be working. I've got 486 MB for my ext3 partition and only 413 available. I'm assuming 73 MB are being used by my programs.
I have 64 MB of internal phone storage available. I don't know what it was before.
I also have 5 desktops with a lot of icons on each one, plus I have a background that is about twice as wide as normal (1067x480 vs 640x480). Still the background is only 70k.
If you want to delete stock apps
Code:
adb remount
adb shell
cd system/app
ls
This will let you see the actual names of apps. From there you can just rm -r them as usual
example
Code:
rm -r VoiceDialer.apk
rm -r com.amazon.mp3.apk
rm -r VoiceSearch.apk
rm -r LatinIME.apk
Don't forget to clear your dalvik-cache after you done nuking stuff!!!
Code:
rm -r system/sd/dalvik-cache
mkdir system/sd/dalvik-cache
You can do all of this from terminal as well but adb make is much easier.
@ OP. I too have only 28-33MB of free ram after closing most of my widgets but I think it's pretty normal as too much free memory means too much wasted memory. And you will not see HUGE improvements in speed neither... there's only so much developers can do. What Cyan is trying to do is to introduce new features (global search, vpn, exchange) without bogging down the system (and doing a great job at it IMHO).
Good luck
^ that is an awesome post. Thank you for that.
Thanks a ton for that. Very helpful post. If I won't see any speed improvements by uninstalling apps I'll just pass on doing that.
Are there any ways I could see speed improvements beyond what Cyanogen already provides?
Limit the amount of desktops, and limit the use of widgets. Power wideget from donut seemed to use a lot of ram and slow things down a little.
why are you people confusing internal storage with system ram?
The information available under settings/sdcard-phone storage/available space reffers to the space available in the /data partition of your phone. Wether you have 1 or 100 (well, 89) mb free in this partition is irrelevant to your phone's performance. All that gets written to this partition is installed apps (not part of the system), dalvik-cache (for ADP or AOSP based roms that don't have their classes pre-compiled), and user data and settings.
People who have 70-89 mb free in that partition are using a2sd, data2sd, and cache to sd, which, imho, is a flippin waste because the internal nand is a lot faster than the bottlenecked bus for the sd card and it's just going to waste if you're not using it. Nothing, i repeat NOTHING is gained by having a free data partition (much like having free space in system which is never going to be used).
Your system has 192 mb of RAM, which is the actual working memory of the device, of those 192, only 90 are available to the dalvik VM, which is the Android part of your phone. This ram can be checked using "free" (if your build has busybox) at the terminal, and this will tell you how much ram is being used by the system, along with how much swap space (if you're using it) is being used. The used ram space fills up fast, and that's a good thing, because unused RAM is wasted RAM. Linux manages things and drops processes as required (to a swap file if available) to free up ram for processes that require it.
To keep your phone running smootly, I'd recomend a reboot every night (when you put your phone to charge). Android is full of memory leaks that have to be fixed, and until they're worked out, the 90 mb ram you have available is all you have to go with (unless you use swap, but one should never really consider that space memory anyway)
The biggest performance difference I've seen has been to shut down my battery widget. After I did that phone's responsiveness has been great.
I'm a heavy AIM user, among other things on Android. For me, AIM always closes when I minimize it, so I tried alternative apps, like the application Hi AIM, which I personally like a lot too. The good thing about Hi AIM is that it has a constant icon in the notification bar showing that it is active therefore I know whether or not I'm signed in or not/if the app has been dropped from memory. I ran several tests IMing myself from my computer with the app open, it works fine even if i minimize it and navigate around my phone. However, if I open up the browser and start loading a website, the icon disappears, and all subsequent messages sent are dropped. This is a large problem for me and therefore the only solution I can think of is locking the application into memory. According to Advanced Task Manager [which I do not leave on, I only use it to check memory], with my phone on standby I usually have around 19-28MB of free memory. I have the 10MB ram hack, as well as CompCache and 32MB swap. I am running the latest Super D with Dark Star theme. The browser obviously has a large memory load and is causing the AIM app to be dropped in favor of running the browser quickly, is there anyway I can lock the AIM app into memory? I understand there will be a minor general slowdown of the phone overall as a part of the memory is now purely dedicated to that single app, but AIM is something I use a lot.
Yes.
I'ts pretty much this thread: http://forum.xda-developers.com/showthread.php?t=652147
Their solution is to "download the AutoKiller app" and press "keep alive"
hope this helps
You just made my day. Thank you very much haha
Advanced Task Manager also works for what you require.
Been using it for awhile now and am satisfied enough to not use another app for such purposes.
I don't know what/how to change this, but this is the code you need to make the sense home app stay in memory. Perhaps its similar to the way you make any other app stay in memory?
Code:
adb pull /init.rc
replace "setprop ro.HOME_APP_MEM ..." with:
setprop ro.HOME_APP_MEM 1536
adb push init.rc /sdcard/init.rc
adb shell
# mount -o remount,ro rootfs /
# cat /sdcard/init.rc | tee /init.rc
# mount -o remount,rw rootfs /
# rm /sdcard/init.rc
I have been using the latests builds to see if they mitigate a common problem in our devices (mine is a Polaris). The insufficient memory makes it lag until forever when switching amongst applications, not only the heavy ones, but also the supposed light applications like Messaging, Phone, Contacts, etc.
The system has to work under really hard conditions: 20 - 28 MB when starting up. Every application I run is a fire proof. Applications like Navigation makes our devices literally crawl and bite the dust. Not far away, I was driving and tried to play some music at the same time. It was impossible. The waiting was unbearable and it finally hung like a pro.
My question is: is there any chance to free up memory or use it more efficiently in order to avoid these undesirable situations?
Did polaris get back some memory with Froyo kernel like vogue did? From the video buffer or something... what res do you run at?
I'm running at 240x320 - 120 dpi
I made a screenshot of a "free" command in a terminal (see attachment image).
My kernel is this one (converted with Atools):
http://androidhtc.git.sourceforge.n...=2.6.32/VOGUIMG-320-FROYO-10-4-10.NBH;hb=HEAD
Thanks for your interest!
Im not sure.. but is there a way to use the sd as ram?
I think its not fast enough, but i havent seen any "benchmarks" yet how fast the ram on the polaris works.
Maby its slower but fast enough to work as swap etc?
Enabling compcache will help you.
Still, our little devices cannot multitask very well with Android, but I can navigate and play music at the same time, with compcache.
You will need drivers that match your kernel, in /system/lib/modules. I have packaged some in the first post of this thread that should work for each of the two popular kernel versions.
n2rjt said:
Enabling compcache will help you.
Still, our little devices cannot multitask very well with Android, but I can navigate and play music at the same time, with compcache.
You will need drivers that match your kernel, in /system/lib/modules. I have packaged some in the first post of this thread that should work for each of the two popular kernel versions.
Click to expand...
Click to collapse
Alright, I'm downloading the modules for 2.6.32. After applying the update, what should I do to enable compcache? Some time ago, this setting was in Spare Parts.
SuperJMN said:
Alright, I'm downloading the modules for 2.6.32. After applying the update, what should I do to enable compcache? Some time ago, this setting was in Spare Parts.
Click to expand...
Click to collapse
Open terminal
type: Su
and then
compcache.sh enable
-Arturo- said:
Open terminal
type: Su
and then
compcache.sh enable
Click to expand...
Click to collapse
any way to confirm that it worked?
margosmark said:
any way to confirm that it worked?
Click to expand...
Click to collapse
type FREE in terminal and look under swap if it shows zero then it's not active.
-Arturo- said:
type FREE in terminal and look under swap if it shows zero then it's not active.
Click to expand...
Click to collapse
yea, try doing free from a terminal you should have an amount of memory for the swap row
For testing...
Thank you SuperJMN for this thread : I hope this help us for better use of our phone.
Like you, when I try to use my GPS navigation (Navigon or Igo8) I'm bored that's too slow !! Impossible to change anything if I want...
I try now with Compcache enable, I can see 130024 (total and 104156 used) instead of 104024 : swap = 26000
Cheers.
manu33xtro said:
Thank you SuperJMN for this thread : I hope this help us for better use of our phone.
Like you, when I try to use my GPS navigation (Navigon or Igo8) I'm bored that's too slow !! Impossible to change anything if I want...
I try now with Compcache enable, I can see 130024 (total and 104156 used) instead of 104024 : swap = 26000
Cheers.
Click to expand...
Click to collapse
any better luck with comcache on??
Report
I installed this update for my .32 kernel (dated September, the 30th):
http://forum.xda-developers.com/attachment.php?attachmentid=409422&d=1285714954
My build is the latest: http://sourceforge.net/projects/androidhtc/files/system-froyo-01-10-10_16.tgz/download
When I open a terminal and type
su
compcache.sh enable
it states that compcache will be enable in 120 seconds.
After that time, a free command doesn't reveal any change.
I've also tried typing
su
compcache.sh start
When doing this, it processes the command and after 30 seconds or so, some lines are displayed:
Code:
insmod: can't insert '/system/lib/modules/lzo_compress.ko': File exist
insmod: can't insert '/system/lib/modules/lzo_decompress.ko': File exist
insmod: can't insert '/system/lib/modules/ramzswap_compress.ko': File exist
swapon: /dev/block/ramzswap0: Function not implemented
vm.swappiness = 30
After that, a free command doesn't reveal any change, too.
SuperJMN said:
I installed this update for my .32 kernel (dated September, the 30th):
http://forum.xda-developers.com/attachment.php?attachmentid=409422&d=1285714954
My build is the latest: http://sourceforge.net/projects/androidhtc/files/system-froyo-01-10-10_16.tgz/download
When I open a terminal and type
su
compcache.sh enable
it states that compcache will be enable in 120 seconds.
After that time, a free command doesn't reveal any change.
I've also tried typing
su
compcache.sh start
When doing this, it processes the command and after 30 seconds or so, some lines are displayed:
Code:
insmod: can't insert '/system/lib/modules/lzo_compress.ko': File exist
insmod: can't insert '/system/lib/modules/lzo_decompress.ko': File exist
insmod: can't insert '/system/lib/modules/ramzswap_compress.ko': File exist
swapon: /dev/block/ramzswap0: Function not implemented
vm.swappiness = 30
After that, a free command doesn't reveal any change, too.
Click to expand...
Click to collapse
Try this one
http://dl.dropbox.com/u/7688082/androidupdate.tar
Also is terminal added to the white list in super user app.?
Try with this update...
l1q1d said:
Try with this update...
Click to expand...
Click to collapse
It worked! Thanks!
By the way, the touchscreen behaves erratically with 4-oct NBH. Test with calibration app and tap the screen. You will notice abrupt lines.
Edit: if you want to see which behavior I'm referring to, watch this video: http://www.youtube.com/watch?v=DPLu41BUB1Y
It happened sometime in the past, but with this one it happens the same (although the abruptness is not as much as in this video).
Edit 2: Strangely enough, it is fixed on reboot, but after some time running the touchscreen starts to behave crappy again. It happens with the newest .NBHs made in October.
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.
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