yashsingh1/xdaforums huggingface dataset:
[Motorola Droid and Milestone General] mike-08:
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.
[Motorola Droid and Milestone General] zeppelinrox:
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.
[Motorola Droid and Milestone General] mike-08:
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.
[Motorola Droid and Milestone General] zeppelinrox:
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
[Motorola Droid and Milestone General] yosriz:
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?
[Motorola Droid and Milestone General] IFLPI:
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)
[Motorola Droid and Milestone General] jabberwocky127:
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:

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.
[Motorola Droid and Milestone General] zeppelinrox:
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 :D
[Motorola Droid and Milestone General] jabberwocky127:
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.
[Motorola Droid and Milestone General] zeppelinrox:
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
[Motorola Droid and Milestone General] mike-08:
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.
[Motorola Droid and Milestone General] zeppelinrox:
I don't know.

But try this:

1. uncheck lock messaging app so it's disabled.

2. run messaging

3. lock messaging in memory again.

It has to work if it's working on my phone.

But if not, keep in mind that I installed RC4 clean.

I had a stock rom that I was testing with and I wiped everything clean before installing RC4.

The only thing that was kept were the apps that were sleeping on the ext2 partion that were installed on CM6
[Motorola Droid and Milestone General] mike-08:
Yes, now that I tried it exactly in this order it works! I just assumed it should work automatically on boot. But I think I can live with that manual thing for now.
[Motorola Droid and Milestone General] zeppelinrox:
Cool

Gotta update the handy dandy fixes thread I'm that case :D
[Motorola Droid and Milestone General] jabberwocky127:
zeppelinrox, you are a saint. Thank you for finding this and enabling me to continue enjoying CM7 :D
[Motorola Droid and Milestone General] IFLPI:
So only gscripts method works ? bacause I made o 97oom file as in the tutorial, and for me it isnt working (CM7 RC3)
[Motorola Droid and Milestone General] jabberwocky127:
This is what worked for me, just got to pray Messaging isn't killed before you can re-check the box, I suppose? I assume this will need to be done every time you reboot, but that's better than the alternative of missing texts. I am on RC4 though, so that might make a difference?
[Motorola Droid and Milestone General] IFLPI:
hmm, ok at first didnt get the idea, but now it seem to work, but as u say it`s not permanent after the reboot. OK, I would appreciated if there is any way to make it permanent in CM7. For now its ok though.

thanks.
[Motorola Droid and Milestone General] jabberwocky127:
Actually, after a reboot, my Messaging app is still in Foreground group with a priority of 0. Maybe a fluke, but maybe it will stick.
[Motorola Droid and Milestone General] zeppelinrox:
It sticks.

I just rebooted twice but after lots of reboots last night it never budged.

Its bulletproofed, baby!
[Motorola Droid and Milestone General] mike-08:
And I think I know what I did wrong so it did not work on reboot: I had a third party SMS app set as default app and it was installed on SD. So, during boot it was not available to fix in memory. I'm now using the stock app installed internally and it works fine.

That's my theory at least. I'll have a look tomorrow to see, if I can verify it.
[Motorola Droid and Milestone General] janosik47:
Have tried to lower the com.android.email app oom to value 0 (zero) via a custom init.d script. It turned out it lasted only for first few minutes after reboot, later AKMO shows it back to default value of 4 ...

Is there any way to permanently lower the oom value for a service app?

EDIT:

When I set oom to -17 via AKMO and then open and close (back to luncher) Email app it got oom at level 1 - as my understanding is Android has changed the oom value.

BUT it does not work in the same way for messaging app - always stays with oom at value 0 (CM7 RC4 with checked messaging protection). Is there any way to have other apps protected in the same way as the messaging one?
[Motorola Droid and Milestone General] ferryPL:
Is there any chance that V6 SuperCharger will make sms app more bulletproofed because of new oom grouping?

I cannot receive sms when I surf web or play games.
[Motorola Droid and Milestone General] zeppelinrox:
In CM7 ROMs, the lock messaging in memory actually works if you uncheckit, run messaging and then check it again.
[Motorola Droid and Milestone General] nacloud:
I have a doubt, I used your script but it seems to not working, the values shown are 7 or 9 sometimes when I want it to be -17.

What I did was I made a copy of 10overclock and from there make the 96oom file, set permisions and reboot.

I want to protect my sms app (com.jb.gosms), but I guess it does not apply because it doesn't start at boot right? If so, running it with gscript lite would take effect?

I have CM7 RC0 2.3.4

Another thing, since this is the sister threat for "[Script] V6 SuperCharger !! HTK & BulletProof Launchers! FIX MEMORY FOR ALL ANDROIDS!" I would like to know if I can run your balance settings 3 or multitasking scripts from the OP menu apply script.

Thanks in advance.
[Motorola Droid and Milestone General] adamz667:
In CM7 you have a two slots in /system/build.prop file for your apps to apply always remain in memory option.

Open it with Root Explorer and search for "sys.keep_app_1="
[Motorola Droid and Milestone General] zeppelinrox:
nacloud the best way is to do as adamz667 said.

When I made this thread, those build.prop options were non existent.

I guess with my farting and poking around in memory issues has provoked some nice alterations and enhancements here and there :)

Do you mean OpenRecovery? For that, use the AOR.zip...
[Motorola Droid and Milestone General] nacloud:
Yes lol that's what I meant "OR"

I did too what adamz667 said.

Thanks both!

Cheers!
[Motorola Droid and Milestone General] ferryPL:
Any chance to find this option somewhere in stock froyo? ;)
[Motorola Droid and Milestone General] zeppelinrox:
Interestng question.

I'd imagine that it would be possible to hack it so it does have the feature.

kabaldan may even put it on a cm6 update.
[Motorola Droid and Milestone General] JokerAce:
Works as it should. Thanks Zep. :)
[Motorola Droid and Milestone General] deejaylobo:
I created a new script with script manager and set the permissions as specified. What I'm trying to bulletproof is Whatsapp (com.whatsapp) but AKMO still shows it set to OOM 5

Is it because Script Manager doesn't do it right? Or maybe it's my MegaRAM 1 OOM settings? I love MegaRAM 1! Makes my MIUI run real smooth. I guess I will have to try lower minfrees, eh?
[Motorola Droid and Milestone General] JokerAce:
After a few hours, the oom level doesn't stick. :|

I am trying to protect multipicture live wallpaper. Wonder why it doesn't stick?
[Motorola Droid and Milestone General] zeppelinrox:
Yeah it's kinda hit and miss unfortuately.

It really depends on the app.

However, I think it works better with the renice command...

So for whatsapp you can save this as a script in script manager and create a SM widget for it and tap it once in awhile:

echo "-17" > /proc/`pgrep whatsapp`/oom_adj
renice -20 `pgrep whatsapp`
[Motorola Droid and Milestone General] deejaylobo:
I wonder what makes Android protect the launcher (through V6) but, not any specified app.
[Motorola Droid and Milestone General] JokerAce:
Sorry, do I need to include this infront?

"

#!/system/bin/sh

sleep 60

"
[Motorola Droid and Milestone General] zeppelinrox:
To use it as a boot script, yes.

Remove the sleep 60 for when you want it to run right away
[Motorola Droid and Milestone General] zeke1988:
SuperCharger require busybox 1.18.2 and this require, GScript, require 1.19.....
[Motorola Droid and Milestone General] zeppelinrox:
ah.. hadn't updated OP... you can use Script Manager
[Motorola Droid and Milestone General] zimphishmonger:
I seem to have issues with this script running on boot (from init.d). It works fine when run via GScript but when run on boot via init.d, it always errors out even if I delay it by ~3 min? any suggestions? Id like to get this running on boot if possible
[Motorola Droid and Milestone General] zeppelinrox:
The whatsapp script? What's the error?

As a quick fix, there is the other option of having script manager load it on boot
[Motorola Droid and Milestone General] zeke1988:
If i want to bullet proof QuickPic, i just need to input these code into script manager right?

#!/system/bin/sh

sleep 60

PPID=$(pidof com.alensw.PicFolder)
echo "-17" > /proc/$PPID/oom_adj
[Motorola Droid and Milestone General] vesparados150:
ok heres the thing, bulletproof an app "on the fly"(using adb "echo" command), it will have the given value(lets say -17). it stays that way as long the app is not executed. That is, the value remains at -17. however, if u run the app, it returns to the default value. IS it just me? even lowering the oom value with AKMO produces the same result. Confirmed with both AKMO and adb echo command.

btw, im on ecllair 2.1 HO!NO! telus v5 rom.
[Motorola Droid and Milestone General] plenoz:
sorry guys i really2 blind with this ...

i have supercharged in My DX usin mega memory 1 and running flawless, but i found the issue i can not receive sms and i assume because it auto killed.

can anyone give the simple way to exclude stock sms application , gtalk app to prevent from autokill by the script

thanks before
[Motorola Droid and Milestone General] zeppelinrox:
I've included bulletproof app in V6 SuperCharger....

Updated August 21

: - V6 SuperCharger Update9 Beta1

Remembers - scrolling speed. You can change it under Options (#19)

Added - BulletProof App!

Added - Engine Flush - Quick Boost & Eliminate Lag!

Added - Nitro Lag Nullifier (Experimental)

Added - Options (Change scrolling speed)

More Compatible - Backs up build.prop and cleans ADJ and MEM values from it - some roms are pesky that way

http://xdaforums.com/showpost.php?p=15948434&postcount=1127
[Motorola Droid and Milestone General] mattfox27:
so if i use this in the v6 script do i have to run v6 script on startup everytime for it to execute or does just the bulletproof app option just needed once and it works from then on. Im not using v6 right now so it doesn't startup but im trying to lock the dialer into memory so it comes up faster...
[Motorola Droid and Milestone General] mattfox27:
any updates with this? Im trying to lock dialer into memory. After about an hour running a DX2 it goes from 1 second to 3-4 sec to open.

Does the original script still work?
[Motorola Droid and Milestone General] zeppelinrox:
yeah it should still work... but add the renice -20 command

Another option is the loopy smoothness script
[Motorola Droid and Milestone General] mattfox27:
What does the renice command do? Just out of curiosity?

Is this the renice commanf -> "echo "-17" > /proc/$PPID/oom_adj"

With the loopy script what does that do diffrently?

I used the parameters in the first script of this page and it seems to be working so far, with renice at 17...do you think the loopy script would work better?

Is there anyway to do this to lockscreen to make it come up faster? Running a DX2
[Motorola Droid and Milestone General] zeppelinrox:
renice -20 $PPID

Not sure since I haven't tried the loopy script.

It doesn't change the oom to -17 tho
[Motorola Droid and Milestone General] mattfox27:
so just add this to the existing script "renice -20 $PPID"

Or change "echo "-17" > /proc/$PPID/oom_adj"
[Motorola Droid and Milestone General] zeppelinrox:
echo "-17" > /proc/$PPID/oom_adj

renice -20 $PPID
[Motorola Droid and Milestone General] mattfox27:
Got it...thank you
[Motorola Droid and Milestone General] mattfox27:
So im trying to lock the dialer in memory to make it come up faster after a while it gets slow to load then loads fast for a while ect... Would com.android.phone be the resource to bulletproof or is there something else. Is there a dialer program somewhere i can't locate anything like com.android.dialer, this is what i have.

#!/system/bin/sh

sleep 60

PPID=$(pidof com.estrongs.phone)

echo "-17" > /proc/$PPID/oom_adj

renice -20 $PPID
[Motorola Droid and Milestone General] zeppelinrox:
#!/system/bin/sh

sleep 60

PPID=$(pidof [B]com.android.phone[/B])
echo "-17" > /proc/$PPID/oom_adj
renice -20 $PPID
[Motorola Droid and Milestone General] mattfox27:
thats weird why that estrongs is there i input android not estrongs...weird

can i put multiple things in there...

#!/system/bin/sh

sleep 60

PPID=$(pidof com.android.phone)

PPID=$(pidof com.android.dialer)

echo "-17" > /proc/$PPID/oom_adj

renice -20 $PPID
[Motorola Droid and Milestone General] zeppelinrox:
No PPID can't have 2 values... it gets changed to the second one so com.android.phone won't be effected.

But I've been using pgrep now anyway which is easier and saves typing...

So instead of....

PPID=$(pidof com.android.phone)
echo "-17" > /proc/$PPID/oom_adj
renice -20 $PPID

I now do:

echo "-17" > /proc/`pgrep phone`/oom_adj
renice -20 `pgrep phone`

This works pretty good but be sure "phone" is a unique process and that no other process has the word phone in it...
[Motorola Droid and Milestone General] eliteforce:
Hello! i use V6 SuperCharger and multitasking settings!

but want to make GOContacts BulletProof :)

i use Script manager can i use it instead of GScript Lite?

Or i can create file and put it in /system/etc/init.d/?

"Then reboot to test!

You can check to see if it worked with either Auto Memory Manager (AMM) or AutoKiller Memory Optimizer (AKMO)."

How to know if it worked because those apps not showing to me this process GOContacts
[Motorola Droid and Milestone General] mattfox27:
Hey Zepp i just had a quick question...if i wanted to use the above script to keep 2 prcesses alive what would the code look like...i know v6 does this im just trying something on my own and i want to Bulletprrof com.android.phone and com.android.smartkeyboard.

Would this work? or how do you do multiple apps?

PPID=$(pidof com.android.phone, com.android.smartkeyboard)
echo "-17" > /proc/$PPID/oom_adj
renice -20 $PPID
[Motorola Droid and Milestone General] zeppelinrox:
Yes you can use Script Manager of course.

Yes you can make an init.d script too.

Well, if they don't show up in memory, relaunch gocontacts and the bulletproof script. You can have script manager schedule the script to run at scheduled intervals too.

Well you can only do one at a time so...

PPID=$(pidof com.android.phone)
echo "-17" > /proc/$PPID/oom_adj
renice -20 $PPID

PPID=$(pidof com.android.smartkeyboard)
echo "-17" > /proc/$PPID/oom_adj
renice -20 $PPID

As mentioned before, I prefer pgrep to get the pid, since I only need to know a part of the process name, so I'd do this:

Or you can have each bulletproof command on one line since you can use the ; to denote a new line so something like...

echo "-17" > /proc/`pgrep phone`/oom_adj; renice -20 `pgrep phone`
echo "-17" > /proc/`pgrep smartkeyboard`/oom_adj; renice -20 $`pgrep smartkeyboard`
[Motorola Droid and Milestone General] mattfox27:
So with this version there would need to be 2 files like

97applock

PPID=$(pidof com.android.phone)
echo "-17" > /proc/$PPID/oom_adj
renice -20 $PPID

98applock

PPID=$(pidof com.android.smartkeyboard)
echo "-17" > /proc/$PPID/oom_adj
renice -20 $PPID

But with the other way i can put those two lines in the same file?

99applock

#!/system/bin/sh

sleep 60
echo "-17" > /proc/`pgrep phone`/oom_adj; renice -20 `pgrep phone`
echo "-17" > /proc/`pgrep smartkeyboard`/oom_adj; renice -20 $`pgrep smartkeyboard`
[Motorola Droid and Milestone General] zeppelinrox:
Using the first way, they can both still go in the same script.

First, PPID is associated with the phone and it gets bulletproofed then PPD is associated with the keyboard and then that gets bulletproofed.

But the second way looks really neat :)
[Motorola Droid and Milestone General] mattfox27:
Sorry im just trying to get this right...so

V1

#!/system/bin/sh

sleep 60

PPID=$(pidof com.android.phone)
PPID=$(pidof net.cdeguet.smartkeyboardpro)
echo "-17" > /proc/$PPID/oom_adj
renice -20 $PPID

V2

#!/system/bin/sh

sleep 60
echo "-17" > /proc/`pgrep phone`/oom_adj; renice -20 `pgrep phone`
echo "-17" > /proc/`pgrep smartkeyboardpro`/oom_adj; renice -20 $`pgrep smartkeyboardpro`

Is this correct?
[Motorola Droid and Milestone General] zeppelinrox:
Almost... V2 is right... I fixed V1 :)

edit: doh... I made a typo in the V2 before... there was a $ on the second renice line so both are fixed :p
[Motorola Droid and Milestone General] mattfox27:
Thank you so much for the help...much appreciated
[Motorola Droid and Milestone General] lawsonmh15:
Set it to run using scriptmanager and getting error code 2. On Miui. Do I need to create the directories???
[Motorola Droid and Milestone General] mattfox27:
If this helps anyone, so far i have tried V1 and it seems to be working keeping my phone locked in memory...i haven't tried V2 yet but i will and post my results when done...

See Post 73 above...

Thanks

---------- Post added at 06:47 PM ---------- Previous post was at 06:44 PM ----------

Do you have an init.d folder? It works way better if you just drop scripts in there it runs them by default on startup, like the startup folder in windows.
[Motorola Droid and Milestone General] lawsonmh15:
Of course I do, but Autokiller shows the default oom values after several minutes so I incorporated SM to see the log which says it can't do it because the proc/ directory doesn't exist so it likely won't work either way which is why I'm wondering what I need to do to get it to work.
[Motorola Droid and Milestone General] zeppelinrox:
For an app to have a PID, it has to be running.

If it's not running, it won't have a PID and therefore no corresponding /proc/$PPID directory.
[Motorola Droid and Milestone General] lordofazeroth:
Hi.

I have a few questions:

1)

I did the same:

but with a semicolon on the end.

Is this also working?

2)

Are the PIDs changing all the time?

3)

is the file oom_adj in Ram or in Rom?

If it is in Rom, isn't this bad for the lifecycle of the Rom, as it is always rewritten?

4)

I have a script.sh in system/etc.

(imagine this question about any script)

is this script executed only once on boot or all the time?

5)

If some Apps are executed long after boot, for example a File Explorer, how can these be added to the bulletproof background list?

6)

Is it possible a script runs every x seconds?

Does this have an effect on the device - performance perhaps?

7)

are autokiller and auto memory showing the correct priority values?

Are they -17 after running a script, so I can check with these apps if the script is working properly?
[Motorola Droid and Milestone General] lordofazeroth:
nobody? :(