• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Adventures in disabling OOM killer in Android

nickdalzell

Extreme Android User
Jun 17, 2011
6,600
2,098
Owensboro, KY
Playing with root again :)

Got my S4 rooted and wanted to be in full-control of apps running. i wanted to use my S4's entire RAM and not have Android sneakily close apps i prefer to be open (when enough memory exists to run my preferred 5-6 apps). Before TouchWiz was relentless in never allowing more than 4 apps to run (well, the task manager in TW), so if i wanted to keep Amazon MP3 open, my email open, ES File Explorer open, Aldiko open, and Sherpa assistant open, well, i couldn't. sooner or later my Aldiko app got shut down, and i had to be annoyed at the rather choppy reload delay instead of a smooth multitasking transition.

Fed up after it continuing despite changing all minfree settings to zero MB, i tried to play with V6 Supercharger, and essentially bulletproofed everything. five apps? no problem! how about seven? still going!

Finally. now i can have it my way! wish i tried this sooner! smooth multitasking
 
I wasn't aware of you recommending V6 Supercharger hacks?

Either way i'm happy that i can run as many apps as i want (within the limits of the RAM, too much and panic!) and knowing i can have the few i want open and knowing they will still be open when i come back to them. I was so sick of leaving say, Aldiko (old iBooks like ebook reader) for a few days and when i came back to it, it reloaded and i knew it was killed off. i expected a smooth resume. well, now i got it. i bulletproofed everything so now there is no auto-kill and it might be a bit risky, but so long as i don't use too much RAM and such, i'm fine.
 
Upvote 0
So, if these apps are "bulletproofed" (I'll admit to reading nothing) .... What happens if you load say a large game requiring more ram.. What happens then?
I'm actually looking for a sub forum/thread to post about the AF forums app because although I use it a few times a day, it still gets kicked out of ram regularly....
 
Upvote 0
Well, to answer your question Funky, i done that already, if only to test the script to be sure it works

I bulletproofed all the apps i use, such as Amazon MP3, Google Books, Email, Browser, and so on. but with all those going, i am only using 1GB of the 2GB on my phone, and this includes all the background stuff (content providers, notification receivers, core system services, etc)

I launched Angry Birds (granted an old copy but a heavy game nonetheless) and played a few levels, and exited out. to my satisfaction, the seven apps i had running were still running, no loss in performance while gaming either. keep in mind that part of that might be the tweaks in the script as well. it did redo all the minfree stuff

So long as i don't top out all my RAM nothing bad happens, and if it does, an app just FC's. V6 Supercharger just modifies the OOM killer a bit, to speed performance a bit, and the buletproof apps list only makes the apps have a priority of 0 (overcommit to -17, aka can't be killed) which helps with launchers that tend to redraw all the time. but the seven or so apps i use were being closed when plenty of RAM still existed, meaning a god half of my phone's RAM was being wasted. i also hate redraws and choppy reloads. the apps i use often now stay open and smoothly switch back when i multitask.
 
  • Like
Reactions: funkylogik
Upvote 0
on a 1GB phone it would be helpful to bulletproof the launcher (so it doesn't redaw) but i'd be more strict with one of those.

You can easily use the script and edit the list on the fly though. Android tends to believe it knows better than me, and assumes Google Search is more important than Amazon MP3 Store. i am a control freak. i want an app to stay open until i decide myself to close it, and exit when i decide i don't need it. Just like i expect my car to run until i turn off the key. i'm not a fan of an OS or other gadget doing things for me.

If anyone knows of a widget that can show a graph of RAM use, i'd like that, to monitor the use so i don't go over. it's sucky to have to manually open Samsung's Task Manager.
 
Upvote 0
I'm Scottish please :D
Oh. OK.

So you escape under the cover of darkness and a faint moon over the moor, where not even the dogs can track you over the peat, through the heather, dating Heather, or whatever it is that moors have. (I've only visited them in the Hound of the Baskervilles so I'm not exactly an expert ok.)

PS - yeah I think I got the resource war reference, my answer is funnier though.
 
  • Like
Reactions: funkylogik
Upvote 0
  • Like
Reactions: funkylogik
Upvote 0
Obviously, as HoTB is set on Dartmoor in Devon England. :D
That's exactly why I penciled him in as being able to escape - I didn't say that the moors were Scottish - I just figured a good Scot didn't want to muck about in a tunnel.

If you want me to write him in with bullets flying around a muir, fine, I'm equally expert at them.

Next episode -

"Funkylogik in App Death Takes A Holiday - Murdered Memory On The Muir"
 
Last edited:
  • Like
Reactions: funkylogik
Upvote 0
So can this "theoretically" run on "any" android phone running 4.4? To keep certain apps open of course.

Also, what happens if you "bulletproof" the youtube app, start a music (or another) video, then exit youtube (by pressing home and/or switiching apps)?
It's no theory - but - from ICS on, part of the app control is in the services.jar file and you can't modify that with this in KitKat.

So, you'll get a partial - but often effective - modification.

Remember that "bulletproof" is hyperbole - foreground apps always take precedence.

Never use without a nandroid backup first.
 
Upvote 0
You can still close a 'bulletproof' app, it just can't be shut down if you leave it running. I was just sick of apps shutting down when plenty of RAM existed, and me having to watch a choppy reload. When I leave apps running (by hitting the home button) I want to go back where I left off smoothly, not have launchers redraw or chrome reloading all my tabs, or Play Books restarting with a choppy animation. If I leave apps open I use often, by golly they're going to stay open until I decide to shut them down.

I'm not going to have my control taken from me, the OS does as I say, not the other way around.

In 4.4, not all apps seem supported. During the setup, some apps don't show a 0 priority or -17 status, showing blanks there instead, and can't be modified this way. A partial workaround involves using an older version such as the original YouTube or original version of Play Books, or an old version of Chrome, which seems to work fine.

Apps from third parties seem hit or miss. I couldn't, for example bulletproof Aldiko so I found it exiting on its own after a time. Same went for Amazon MP3, also exiting to 'free' RAM despite more than enough being available

I do wonder if I can actually delete the 'sigterm' binary so no apps can quit
 
Upvote 0
From the Equal Time Department for people who don't have Nick's problems -

http://androidforums.com/threads/pu...k-killers-ram-optimizers-and-the-like.896663/

The control mechanisms in Android are NOT unique.

They are inherited from desktop Linux and Android acts the same. Except that desktop Linux isn't managing a real time telephone and desktop Linux does have a hard drive to extend virtual memory.

For those of you new to Android or less familiar with how operating systems work, Android is not Windows or iOS and doesn't need to have everything managed to the Nth degree with you in control of everything.

If your phone behaves as badly as Nick's, look into a custom rom or change your app mix.

And Nick - you don't need to rebut this and have the last word and explain again why you're right. You ought to consider Linux kernel programming instead. You hate your Samsung kernel and how they deal with services? Stop using bandaids and advertising on why you think Android is broken. It's open source - if you have that much trouble, change it.

The OOM minfree values are just a few of the performance tuning parameters available to the operating system.

They're fun to modify and for a poorly made, laggy phone, can be helpful to adjust.

They're not a panacea.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones