[FIX] Bulletproof Background Apps!

Search This thread

deejaylobo

Senior Member
Feb 22, 2011
559
57
Abu Dhabi
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?

Sent from my Google Nexus S using XDA App
 

JokerAce

Senior Member
Sep 23, 2009
1,554
690
Teleporting..
After a few hours, the oom level doesn't stick. :|
I am trying to protect multipicture live wallpaper. Wonder why it doesn't stick?
 

zeppelinrox

Senior Member
Dec 21, 2010
9,374
21,590
IN THE FREAKIN' OP
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:

Code:
echo "-17" > /proc/`pgrep whatsapp`/oom_adj
renice -20 `pgrep whatsapp`
 

deejaylobo

Senior Member
Feb 22, 2011
559
57
Abu Dhabi
I wonder what makes Android protect the launcher (through V6) but, not any specified app.

Sent from my Google Nexus S using XDA App
 

JokerAce

Senior Member
Sep 23, 2009
1,554
690
Teleporting..
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:

Code:
echo "-17" > /proc/`pgrep whatsapp`/oom_adj
renice -20 `pgrep whatsapp`

Sorry, do I need to include this infront?

"
#!/system/bin/sh

sleep 60
"
 

zeke1988

Senior Member
Apr 9, 2010
697
35
SuperCharger require busybox 1.18.2 and this require, GScript, require 1.19.....
 

zimphishmonger

Senior Member
Jun 4, 2009
3,890
729
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
 

zeke1988

Senior Member
Apr 9, 2010
697
35
If i want to bullet proof QuickPic, i just need to input these code into script manager right?

Code:
#!/system/bin/sh

sleep 60

PPID=$(pidof com.alensw.PicFolder)
echo "-17" > /proc/$PPID/oom_adj
 

vesparados150

Senior Member
Aug 11, 2010
85
3
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.
 

plenoz

Member
Aug 4, 2009
46
4
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
 
Last edited:

zeppelinrox

Senior Member
Dec 21, 2010
9,374
21,590
IN THE FREAKIN' OP
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
 
  • Like
Reactions: hearts king101

mattfox27

Senior Member
Nov 12, 2010
661
86
Los Angeles
www.mkxtech.com
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...
 

mattfox27

Senior Member
Nov 12, 2010
661
86
Los Angeles
www.mkxtech.com
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?
 
Last edited:

mattfox27

Senior Member
Nov 12, 2010
661
86
Los Angeles
www.mkxtech.com
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
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 44
    UPDATE: Try BulletProofing Apps with my latest V6 SuperCharger Script! Use the following link OR use the link in my signature :D

    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 :D

    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 :D

    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 :D

    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!
    4
    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.
    3
    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...
    3
    Persistent bulletproof apps/ bulletproof service

    I may be wrong, but the bulletproof apps script only runs once at boot, then calls /data/97BulletproofApps.sh, so it seems you get two shots at bulletproofing an app.

    The problem, as I see it is that if your app isn't running at boot or in a few minutes after boot, it won't get bulletproofed.

    If you want the script to stay persistent so that your chosen apps get bulletproofed whenever you decide to launch them, you can do something like:

    ---------------
    #!/system/bin/sh

    while true; do

    for i in com.waze com.myrt.andrevocadjuster com.google.android.apps.maps com.android.music com.mixzing.basic mobi.mgeek.TunnyBrowser com.android.browser ;

    do
    j=`pidof $i`
    echo "-17" > /proc/$j/oom_adj
    renice -10 $j
    done

    sleep 60

    done
    -------------

    On the "for i in" line just place a space-separated list of the processes you want to bulletproof.

    I've used a nice value of -10, as I've always understood from my Unix days that it's good to let the system processes exist at a lower nice level than user processes (so that swap, I/O and other system processes get priority and keep the system running smoothly). I may be wrong.

    The only problem would arise if android decided to kill the 97oom shell process. Having looked into this, you could instead move 97oom into /system/xbin (or another location if you prefer) and add these lines to your /init.rc

    ----------
    # bulletproof as a service by evilj, with thanks to zeppelinrox for bulletproof and SuperCharger
    service bulletproof /system/xbin/97oom
    user root
    critical
    # bulletproof end
    ----------

    The "critical" line makes the android system restart the service if it gets killed.

    However, I noticed that 97oom is running at an oom level of -17 anyway, so it's unlikely to get killed unless you do it yourself, so maybe it's a case of overkill (pun intended!)

    Hope this helps. Please give me a thanks if it does.

    J
    3
    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