[Q] Possible to keep background apps in low mem situations? - G1 Q&A, Help & Troubleshooting

Is there any way to keep certain background applications running if memory runs low and the android garbage collector goes around killing processes that are running in the background?
I have the problem that under low memory situations android kills all my background apps and especially services. This is ok for most use-cases, but is really annoying especially for my Jabber client and sometimes even the music app.
I looked through the API doc and found that you can set Service::setForeground(true) to prevent the service from being killed. This is nice for open source apps, but I can't prevent closed source apps from being killed that way. And I'm not even sure if it helps in all cases, as the music app should be using it and gets killed too.
Does anyone know how I could exclude certain apps from being killed in the BG? Which process is responsible for doing that? Wouldn't it be possible to patch that process or part of the kernel to exclude certain processes?
I know there are workarounds for keeping the launcher in memory by restarting it all the time. That wouldn't help in my situation where the Jabber service has a permanent network connection going.
Anyone got technical information for me on this?

You created a new thread with [Q] so why don't you create it in Q&A forum. Thread move.

Related

Built-in App Info?

I have always been in the habit of streamlining everything (I.e. disabling all useless services in windows, etc.). Is there any information on which of the preinstalled apps I can remove? I'd feel safe getting rid of things like Google Talk and Amazon MP3 but am unsure what things such as "checkin service" do.
I removed about 6 apps from /system/app and noticed I could no longer download from the market. might do a little trial and error when I have more time.
Anyone have a source for this info?
From what I am able to gather, it appears Google Talk is needed for Market to work. No idea why, but it's needed.
See, google talk is always running in the background and I can't stand that. Would reducing the amount of apps in the "processes" tab in task manager improve battery life or increase internal memory? Just wish I had the time and resources to figure some of this out.
r4d14n7 said:
See, google talk is always running in the background and I can't stand that. Would reducing the amount of apps in the "processes" tab in task manager improve battery life or increase internal memory? Just wish I had the time and resources to figure some of this out.
Click to expand...
Click to collapse
Yes & yes, sorta.
Obviously closing out background apps can improve performance, but noy by much. Android will automatically start killing background apps when it senses that it's low on memory. Biggest thing is when that "low" memory is. Your threshold is probably different than Androids.
So yes it does help, but not by much.
Oh, also, lots of apps are called up by system processes, so no matter how many times you kill them, they come back.

App Request - kill tasks, then launch another app

Enjoying Taskiller - works very well.
Most users know their apps run better once unnecessary background apps / services have been killed.
Another set of users continue to complain about specific games or apps being laggy without taking steps to solve the problem.
Case in point is the camera application which needs more memory than most and often gets out of memory exceptions.
What would be great is if Taskiller or one of the other task closing apps could create a configurable desktop shortcut that would kill all unneeded apps, then launch a preconfigured app, e.g. camera app.
Users would need to understand that clicking this button to launch another app will lose state in any running apps, but will most likely mean the game or app they then run will have far better performance and be less laggy.
Any takers?
Though im the tiniest bit of confused...
A) If this app TaskKiller (never used) worked so well, whats the need for another?
B) I am also unsure if its absolutely necessary for the android platform. Maybe older phones or WinMo phones (<6.1) have this problem. But as far as I know, android has a garbage collector in which it treats its processes with priority and after a certain utilization, it ends it (for instance. I am playing gameboid, then just hit the home button. I can go back to gameboid fine. But if I open a large app after 'minimizing' gameboid (like opening the htc music player), gameboid will end and I will have to reload it again. Though if I open msgs while gameboid is minimized, gb stays up.
Its supposed to do that. So this request I am not sure if its really necessary.
Killing background apps when memory requires is the theory behind the OS but doesn't always work in practise.
For example, play any game on Android and you'll see occasional judders in the scrolling, etc. - this is usually because a Facebook or Twitter app on the phone has decided that its a good time to get some new notifications ... but that spoils the game experience.
I hate to mention the fruity phone but this is one of the places where it beats Android hands down and their games are in a different league to ours.
I think a way to clear the phone's background processes before launching a game / resource intensive app would make a big difference.

[Q] Apps kept coming back after autokill -> memory leak -> lag

Hi all,
1. I've got these applications (Smartone-Vodophone SV app, 5 days weather, google map, social hub and such) that would keep coming back, relaunching themselves even after I put them onto my task manager's autokill list. Seems like they would wait around for me to enable the wifi/3G connection and then launch themselves. I even installed other apps to disable autolaunch and they would still launch themselves in the background every now and then. I had to kill them every time I unlocked my screen and these "launching and killing" cycles eventually depleted my memory down to below 100MB, making the lag situation even worse. Does anyone know how I can stop them from launching, without having to uninstall these apps?
2. I haven't installed the lagfix and I understand that the fix has to do with reformatting the apps' partition with a faster file system to reduce the lag (probably by giving it faster I/O access to the program's binaries?) I'm still waiting for Froyo, which should be out in a couple of weeks in my country. Does anyone know if Froyo would take care of this file system problem? Even with the Froyo or one-click lag fix, it still would not solve the apps launching and memory leak problem, right?
3. I notice that after I've installed more apps, the lag situation got worse. I was playing some songs on the external SD cards and it choked once in a while. I made sure I killed all the other apps and that I still got 100+MB to run just this one song player app and yet it would still choke. This tells me that the lag has nothing to do with available memory. And the player app was stock that came with the phone so there shouldn't be any fragmentation issue (apps installed later might have?) that makes it run slow. And if its the bad file system, this app, running all by itself, should have all the I/O bandwidth to itself so the access to the app's binaries should not have any lag... and neither should the access to the songs on the external SD card. So what exactly is causing the lag then? I don't see how the lagfix would solve this problem either. I actually have read that the lags would come back after a period of usage even with the lagfix. Anyone got an insight to this problem? What exactly is causing the lag? and why installing more apps seem to make it worse? and would Froyo be able to fix all these problems?
Thanks a lot.
@boarder838
I think you really need to read a lot more about just how Android works as you seem to have some strange ideas about how it works.
To start with you need to realise that having 200mb or 100mb of free Ram makes zero difference to performance only when you have no free Ram is it a problem and even then the system will sort it out for you by closing the least used program. Free Ram is just wasted Ram as it's not doing anything and will not make your device respond or work faster using a Auto Task Killer is wasting your battery and slowing down your device not speeding it up and saving battery as you seem to think. As i have pointed out above stop obsessing over your free Ram amount as unless you have none its not a problem stop using a Task Killer and you will most probably see your device responds faster as its not constantly killing things and just leaves them open doing nothing in the back ground which doesn't use Ram or Battery so just leave them be.
Yes Froyo will bring many improvements to our devices but won't fix a problem that doesn't exist re memory leaks and apps launching that you seem to think you have. I don't know but some of those apps may be system apps that need to run all the time which is why they keep relaunching. As for a lag fix well that's what we are all hoping for but if not I'm pretty sure the great people of this forum will come up with an easy to apply fix to it.
I have absolutely no problem playing Music or even streaming it over Bluetooth no lag stutters or break ups at all although my Music is on the Internal SD card. Maybe you should look at the quality that you have encoded your Music in as that may be causing problem. maybe some of the apps you have installed are also causing a problem but its impossible to know as we all install different apps and have different set ups.
I don't know how much experience you have with Android devices or flashing Roms but if you read enough and understand it you have the possibility to flash custom Rom's and various tweaks and fixes to make your device how you want it. That's part of the beauty of Android but don't rush into anything you are not sure about as you can end up with an expensive brick so read things many times and make sure you understand step by step what you are doing if you are going to attempt any of these things.
If you look at my signature you will see i am running a Custom Rom that includes a lag fix and various other tweaks it also allowed me to remove some of the programs in the official Rom that i didn't want or need. For me my device runs nice and smooth and fast of course I'm looking forward to Froyo and all the improvements that will bring but I'm quite happy with my Galaxy S the way it is now. Oh and this is my second Android device and I've never used a Task Killer never mind an Auto Task Killer and have never seen an out of Ram message either.
Marc
exactly what he said ^
Hi Marc,
Thanks for spending time to read through my long post and reply to it. I probably didn't explain my problem clearly in my post.
There were a couple of reasons I wanted to kill/stop the apps from starting:
1. Even before I installed any of those apps killer, I noticed that the available memory kept going down after a couple days of usage and it went down to below 100M. I figured some of the apps would need 10's of MB to run so I thought I should at least keep 100MB around so that it wouldn't run out of memory and start swapping when I start those apps. I don't know enough about Android but I assume its just like linux or other OS, when it runs out of physical memory, it would start swapping and slow things down. Even after I started using task killer and killed all the other tasks, the memory level would still not recover. That seems to point to a memory leak problem but using "Memory Booster" to do garbage collection seems to help. Still, it would be nice to be able to stop them from launching in the first place. <-- my first question.
2. I do not want any jobs/processes/apps that I don't need to run in the background to drain my battery. I don't think I can say for sure that those apps are all just idling and not using much CPU/battery. There are quite a few of them so if each of them use some CPU time/battery, it will add up eventually. Note that these are not system processes (or daemons as in unix's init.d). They are crappy apps from the cellular provider so I'm pretty sure they don't have to be running (they're probably just collecting my personal data or smth). I just thought there would be a way to stop them from launching without uninstalling them.
Thanks for answering my question regarding Froyo. If they would do the filesystem lagfix then I'll just wait for that update.
As for the music stuttering problem, my songs are on the external SD card but my old Nokia E85 phone has no problem playing with those songs on the same SD card. As I have pointed out in my last question, I was only running one app and with plenty of memory so it had nothing to do with available memory. I also suggested that however bad the filesystem was, the I/O bandwidth should still be enough to run this one music player app (access the program binary/libraries?) and to retrieve data from external SD card to play the music smoothly. So applying the lagfix probably won't help this problem though I still haven't tried the lagfix. Now I'm thinking that one of the task killer might be killing some system processes which were needed by the music player. I probably should uninstall all these task killers and see if it would help.
I have gotten the phone for only a couple of weeks so I haven't gotten around to try flashing different roms or rooting my phone. There's so much info scattered around on the web and I can't seem to find a source that really has the authority or complete information. I'll see if I have time later to look into all the tweaks and such but for now its just a phone to me and I just want it to run smoothly without having to spend too much effort to tune it.
Don't get me wrong. I still love the flexibility and customization opportunities provided by the Android platform and I just love to show off my "Beautiful Weather Widget", "Live Aquarium Wall Paper" and my cool 3D scrolling "Launcher Pro" to my iphone4 buddies and make them drool.
Thanks for you comment and let's hope Froyo will bring us a smooth running and stable platform.
Dogmann said:
@boarder838
I think you really need to read a lot more about just how Android works as you seem to have some strange ideas about how it works.
To start with you need to realise that having 200mb or 100mb of free Ram makes zero difference to performance only when you have no free Ram is it a problem and even then the system will sort it out for you by closing the least used program. Free Ram is just wasted Ram as it's not doing anything and will not make your device respond or work faster using a Auto Task Killer is wasting your battery and slowing down your device not speeding it up and saving battery as you seem to think. As i have pointed out above stop obsessing over your free Ram amount as unless you have none its not a problem stop using a Task Killer and you will most probably see your device responds faster as its not constantly killing things and just leaves them open doing nothing in the back ground which doesn't use Ram or Battery so just leave them be.
Yes Froyo will bring many improvements to our devices but won't fix a problem that doesn't exist re memory leaks and apps launching that you seem to think you have. I don't know but some of those apps may be system apps that need to run all the time which is why they keep relaunching. As for a lag fix well that's what we are all hoping for but if not I'm pretty sure the great people of this forum will come up with an easy to apply fix to it.
I have absolutely no problem playing Music or even streaming it over Bluetooth no lag stutters or break ups at all although my Music is on the Internal SD card. Maybe you should look at the quality that you have encoded your Music in as that may be causing problem. maybe some of the apps you have installed are also causing a problem but its impossible to know as we all install different apps and have different set ups.
I don't know how much experience you have with Android devices or flashing Roms but if you read enough and understand it you have the possibility to flash custom Rom's and various tweaks and fixes to make your device how you want it. That's part of the beauty of Android but don't rush into anything you are not sure about as you can end up with an expensive brick so read things many times and make sure you understand step by step what you are doing if you are going to attempt any of these things.
If you look at my signature you will see i am running a Custom Rom that includes a lag fix and various other tweaks it also allowed me to remove some of the programs in the official Rom that i didn't want or need. For me my device runs nice and smooth and fast of course I'm looking forward to Froyo and all the improvements that will bring but I'm quite happy with my Galaxy S the way it is now. Oh and this is my second Android device and I've never used a Task Killer never mind an Auto Task Killer and have never seen an out of Ram message either.
Marc
Click to expand...
Click to collapse
Oh I found the problem with stuttering music. It was the "beautiful weather widget"! I tried removing all the task killers and aquarium etc and it still wouldn't work. As soon as I removed the weather widget there was no problem with music playback anymore. Anyone has the same problem that pretty weather widget?? I've already set the refresh period to every 3 hours but it still wouldn't help?!

How to stop "running" and "cashed processes"?

I know that android is very good at handling background processes and ram but I have so many apps that I don't use at all. They consume big amount of ram and for instance, sometimes browser loads pages again when I get back to it from another app. I assume this is because of ram. So I guess, if I can shut down some running apps in the background, available ram would be more.
I can see them at settings-apps-running(or cached processes).
For example, right now in "running" section I have 9 processes and 3 of them are poweramp, awesome beats, accuweather.com and in "cached processes" I have 10 processes and 6 of them are beautiful widgets,calendar storage,google account manager, google search, calendar, google play store. Other processes are system services that I have no problem with. When I go to developer settings-background process limit and block them, there are no cached processes anymore but that probably has a side effect. I wish I could choose which apps I want in the background.
I can shut down these apps manually but every time I restart the phone, they are there again. How can I stop them?
if you rooted, you can use Autostarts or ROM toolbox from the playstore. it can change the receivers of the apps not to start at boot
CooLasFcuK said:
I know that android is very good at handling background processes and ram but I have so many apps that I don't use at all. They consume big amount of ram and for instance, sometimes browser loads pages again when I get back to it from another app. I assume this is because of ram. So I guess, if I can shut down some running apps in the background, available ram would be more.
I can see them at settings-apps-running(or cached processes).
For example, right now in "running" section I have 9 processes and 3 of them are poweramp, awesome beats, accuweather.com and in "cached processes" I have 10 processes and 6 of them are beautiful widgets,calendar storage,google account manager, google search, calendar, google play store. Other processes are system services that I have no problem with. When I go to developer settings-background process limit and block them, there are no cached processes anymore but that probably has a side effect. I wish I could choose which apps I want in the background.
I can shut down these apps manually but every time I restart the phone, they are there again. How can I stop them?
Click to expand...
Click to collapse
The simple answer is that you don't need to stop them!
As you say, Android is already very good at keeping track of background processes, to the extent that if a new program needs more RAM, Android itself will kill a background process that hasn't been used for a while to free up RAM for the new program.
The Cached processes screen SHOULD be full of recently used programs; it shows that Android is doing what it is supposed to do and is shifting inactive processes out of active RAM in case you want to load it again, without completely dumping the process memory.
Now, as for the side effect you mentioned, that would be a significant hit on battery life. By holding programs in RAM as it is supposed to do, the OS can load the program quickly and cleanly and more efficiently by simply reading the RAM rather than reading flash, writing to RAM, then reading from RAM. The general mantra for UNIX based systems is that unused RAM is wasted RAM.
Another thing to note is that if you do not close tabs when switching active programs (including going to homescreen) then the Browser is designed to hold that tab in memory. Even if you close the Browser (excluding closing the tab specifically with the "little x"). Even if you reboot the damn phone, it will still load the tabs/pages you had open last. The pages are not held in memory as such, just what was open and what tab order, so if you do open the browser after a while, it will load the last page from scratch.
TL;DR version: The running and the cached processes will remain exactly where they are until a new program needs more RAM than is available, at which point Android will kill something to make room. You do not need to do this manually. It will cause more power drain by making very inefficient use of RAM/Flash memory. Empty RAM is wasted RAM.
whilst Chaos is right, I notice severe performance drops when ram is filled, despite Androids theoretical advantage. It doesnt work...
Best to prevent from loading altogheter.
Root, lose warranty, backup apps, uninstall or freeze apps so the bloatware is removed.
For others, change autostart settings in Romtoolbox. So they wont start on boot.
Search for safe stuff to delete. There are lists for that
Sent from my GT-N7000 using Tapatalk 2
Or just dont install the apps that you dont really need.
Via GtN7000
LoVeRice said:
Or just dont install the apps that you dont really need.
Via GtN7000
Click to expand...
Click to collapse
Lol, even then you might still need to remove bloatware lol
Sent from my GT-N7000 using Tapatalk 2
Thanks so much for detailed answers.

Background Apps closing when navigating away

Is there a way to stop background apps from closing when navigating away from them?
If flicking between a few apps they are going back to the starting screen so are being closed when navigating away. I have searched Google and it looks like a bug Nokia are aware of but is there a workaround to stop this behaviour?
I tried switching on Background activity cleaner and setting just one app to be blacklisted as per a thread I found but this does not work and still all background apps are being closed
With 6GB of RAM you would have thought there could be plenty of apps left to run in the background without too much performance issues

Categories

Resources