Multitasking / Keeping Apps in foreground state - Milestone XT720 General

If i understand Android correctly, it sends applications into a "background" mode when switching tasks? I would like to prevent that. There are some apps (like games or browser) that need quit a bit of time restoring the last state so this would be usefull for some tasks.
Is this possible ?

TyrionWarMage said:
If i understand Android correctly, it sends applications into a "background" mode when switching tasks? I would like to prevent that. There are some apps (like games or browser) that need quit a bit of time restoring the last state so this would be usefull for some tasks.
Is this possible ?
Click to expand...
Click to collapse
Well, switching to background mode just marks the application as not displaying anything. The way memory management on Android works, if foreground apps (i.e. apps that are actively displaying on the screen) need memory and there's none available, then background apps will be put into a stored state that frees up memory for the foreground apps. Coming back from that stored state is probably what you're noticing. Android also tries to keep a certain amount of unused memory around and will put background apps into stored state to achieve that. We do have pretty limited memory available on this device so some level of pausing is always going to happen. See also: http://andrs.w3pla.net/autokiller/details
You may be able to reduce how many background tasks are put into storage by tweaking the minfree parameters (using e.g. Autokiller Memory Optimizer from the market) to tell Android to aim for a smaller pool of free space.

Mioze7Ae said:
Well, switching to background mode just marks the application as not displaying anything. The way memory management on Android works, if foreground apps (i.e. apps that are actively displaying on the screen) need memory and there's none available, then background apps will be put into a stored state that frees up memory for the foreground apps. Coming back from that stored state is probably what you're noticing. Android also tries to keep a certain amount of unused memory around and will put background apps into stored state to achieve that. We do have pretty limited memory available on this device so some level of pausing is always going to happen. See also: http://andrs.w3pla.net/autokiller/details
You may be able to reduce how many background tasks are put into storage by tweaking the minfree parameters (using e.g. Autokiller Memory Optimizer from the market) to tell Android to aim for a smaller pool of free space.
Click to expand...
Click to collapse
Thanks, i'm will give it a try. Is it also possible to max out swap before sending apps to background? I think restoring the ram-state from sd would still be faster for several apps.
Edit: reading your post again, i'm not talking about a tasking switch delay, but apps that completly reload themselves when switching tasks (DolphinMini page load,DungeonHunter as examples). Just to prevent any confusion...

TyrionWarMage said:
Thanks, i'm will give it a try. Is it also possible to max out swap before sending apps to background? I think restoring the ram-state from sd would still be faster for several apps.
Edit: reading your post again, i'm not talking about a tasking switch delay, but apps that completly reload themselves when switching tasks (DolphinMini page load,DungeonHunter as examples). Just to prevent any confusion...
Click to expand...
Click to collapse
Oh... Sorry I misunderstood. I don't know anything relevant to that case.

I've spent a few hours trying to find how to make certain Droid apps maintain their foreground state when put in the background with no luck. Perhaps it just can't be done.
I'm thinking of the Cydia iPhone app called Backgrounder which lets you choose which apps maintain foreground state when put into the background.
This is necessary, for example, with a note application where you are switching between taking notes and looking up info. Every time you switch back to the note app, you need to go back into your note, put it in edit mode and navigate to the section of the note you were editing. If it were acting like a foreground app in the background, when switching back to it it would already have your note open and be in edit mode with the cursor where you left off.
K9 mail has a similar problem where if you have an email open, switch to another application, when you go back to K9 it takes you to your inbox again where you have to navigate to the email you had open before switching.
Is there a tool similar to Backgrounder for Android?
Thanks.

nheacock said:
I've spent a few hours trying to find how to make certain Droid apps maintain their foreground state when put in the background with no luck. Perhaps it just can't be done.
I'm thinking of the Cydia iPhone app called Backgrounder which lets you choose which apps maintain foreground state when put into the background.
This is necessary, for example, with a note application where you are switching between taking notes and looking up info. Every time you switch back to the note app, you need to go back into your note, put it in edit mode and navigate to the section of the note you were editing. If it were acting like a foreground app in the background, when switching back to it it would already have your note open and be in edit mode with the cursor where you left off.
K9 mail has a similar problem where if you have an email open, switch to another application, when you go back to K9 it takes you to your inbox again where you have to navigate to the email you had open before switching.
Is there a tool similar to Backgrounder for Android?
Thanks.
Click to expand...
Click to collapse
Looking for such tool too. Making app to stick with its foreground state even though it is actually in the background. (Make it appear in notification?)

ZDBox is a useful tool... you can download from market its free and the app has the abbility to:
★ Traffic counter: Monthly/daily mobile data usage overview, shows remaining data traffic, detailed data usage information for each app.
★ Do not disturb: Just set days and the time when you need your privacy and you won’t be disturbed by your phone. Set phone to silent, vibration or airplane mode.
★ App lock: Protect apps with a password or pattern, for exmaple your contacts, Facebook, Twitter, Whatsapp,Gmail and so on
★ Task killer: Kill all apps at once, define protected apps which won’t be killed, set auto kill when screen gets locked, mark single or multiple apps to kill
★ history eraser:clean your(Browser history,market search history,Google Map search history,Gmail search history,Clipboard)
★ Notification bar: One tap on the bar shows remaining battery time, running apps, how much data traffic is left and if app lock is active or not. A tap on these informations starts ZDbox.
★ Uninstaller: Shows used/available internal and SD card memory. Apps can be easily uninstalled. Single or multiple (batch) uninstall possible.
★ App to SD: Move apps to your SD card. Single or multiple (batch) move possible. Only for Android 2.2 and 2.3.
★Cache Cleaner:With Cache Cleaner you can clean your cache of phone.protect your secret without a trace.
I hope you can use for keep your running applications with that app...
sorry for my english...

davidequiz said:
★ Task killer: Kill all apps at once, define protected apps which won’t be killed, set auto kill when screen gets locked, mark single or multiple apps to kill
Click to expand...
Click to collapse
This will not help since the task killer which kills the background apps in inside the android system not an external one.
We must find a way to control the internal one then...

nheacock said:
I've spent a few hours trying to find how to make certain Droid apps maintain their foreground state when put in the background with no luck. Perhaps it just can't be done.
I'm thinking of the Cydia iPhone app called Backgrounder which lets you choose which apps maintain foreground state when put into the background.
This is necessary, for example, with a note application where you are switching between taking notes and looking up info. Every time you switch back to the note app, you need to go back into your note, put it in edit mode and navigate to the section of the note you were editing. If it were acting like a foreground app in the background, when switching back to it it would already have your note open and be in edit mode with the cursor where you left off.
K9 mail has a similar problem where if you have an email open, switch to another application, when you go back to K9 it takes you to your inbox again where you have to navigate to the email you had open before switching.
Is there a tool similar to Backgrounder for Android?
Thanks.
Click to expand...
Click to collapse
Guys, I'm so much looking for a solution of this same thing. The closest I came to is Ram manager. Has a xda threat and can be found in the play store. But it also can't manage to lock an app and prevent its killing (although it helps a lot). I need my navigation always running and it is silently killed or stopped while I'm looking at my mail or have a phone call. This is ridiculous. Have you found a solution. Some way to protect an app from killing and lock it in the foreground. I mean how are they able to do it for the apps which are in the system tray!? Like antivirus apps and tons of other. I can't believe xda experts don't know how...

I would think that Antivirus apps run a service.
In Mioze's CM6 there are build prop edits that might work, but I never tried them.
Code:
# apps to be kept in memory (specified by process name)
# use with caution, RAM is limited!
sys.keep_app_1=
sys.keep_app_2=

I am not an expert and can't tell the difference between service and an app running. What you're saying makes sense, but I need clear instructions somewhere to make an app protected from killing. Thanks for helping.
Sent from my HTC One X using xda premium

Wrong forms this milestone xt720.
Sent from my SGH-T759 using xda premium

I pretty much fixed android multitasking - even on ense 4.0 and 4.1
http://forum.xda-developers.com/showthread.php?t=1900626
Testers welcome.
And for locking an app in a foreground state, my SuperCharger can do that via BulletProof Apps menu.

zeppelinrox said:
I pretty much fixed android multitasking - even on ense 4.0 and 4.1
http://forum.xda-developers.com/showthread.php?t=1900626
wI
Testers welcome.
And for locking an app in a foreground state, my SuperCharger can do that via BulletProof Apps menu.
Click to expand...
Click to collapse
I tested that and almost became an expert. I'm not so sure if it is completely solved, although I have to admit that you have done a great and recognized job.
Just tell me can the script for bulletproof apps work alone, without the supercharger script. Many ROMs have their own memory settings and one is afraid to cover them with supercharger script settings.
But if bulletproof script can run and do the job on itsown then the problem is really fixed.

Yeah its separate.
Alot of devs say dont supercharge because they dont want to be showed up and scare their users lol
But hundreds of roms come supercharged anyway.

zeppelinrox said:
Yeah its separate.
Alot of devs say dont supercharge because they dont want to be showed up and scare their users lol
But hundreds of roms come supercharged anyway.
Click to expand...
Click to collapse
Thanks for answering!
So I'm going to try running only the bulletproof script without the supercharger script and set an app to be UNbillable.
Should I set it to run on startup!? I'm using custom ROM. The last revolution HD.

The init.d script would run automatically.
So you dont need to configure anything.
Whatever app is in the hitlist will get bulletptoofed soon after running the app.

zeppelinrox said:
The init.d script would run automatically.
So you dont need to configure anything.
Whatever app is in the hitlist will get bulletptoofed soon after running the app.
Click to expand...
Click to collapse
I am trying to get this configured. But I only want to run the bulletproof script, not the 99SuperCharger script. I just want to keep my rom's memory settings, cause I am OK with them.
But both of the scripts (99SuperCharger and bulletproof) are going to reside in the init.d folder of my custom rom. So they will both be started, aren't they?
How can I make only bulletproof script run at boot. Should I just delete 99SuperCharger from init.d?

Related

G1 Startup Manager

Running Applications
Hi, im considerably new to the whole android development i have a g1 since early december and have upgrade it to the modded JFC 1.31 ADP. I also have the adp spl i think thats what u call it .
My question relates to the running processes/tasks/programs. I am concerned about the amount of programs that run in the background. Is there a way to cut down on this?
I have already removed Calendar, Amazon, Calculator, Calendar Provider seeing as how i do not intend on using these as for calculator i have installed a scientific calculator.
Its more or less Facebook, Craigslist, Imeem. The other bckg progs Gmail, Messaging, Alarm Clock are all smth i use so therefore i have no issue on that but ive tried editing settings on Craigslist, Facebook, Imeem and others to change the update interval and have maxed those out but still tend to run in the background i use the programs but i dont need them to update themselves.
Edit: I have also stopped the auto sync on Calendar, Gmail, Contacts Seeing as for Calendar i dont need it, Gmail i check it often, Contacts i dont use on my gmail service.
Have you got the task manager app from the app store? Thats what I do, and kill all the apps I don't need active.
TimSykes said:
Have you got the task manager app from the app store? Thats what I do, and kill all the apps I don't need active.
Click to expand...
Click to collapse
Yes i have, however they keep coming back up!
yeah I know some of them do. to me I don't know why alarm does. I don't even have a alarm set on my phone.
They come back due to the way android handles and saves tasks. The OS will keep resurrecting them thinking they are just dormant and were axed by them.
ArronL said:
They come back due to the way android handles and saves tasks. The OS will keep resurrecting them thinking they are just dormant and were axed by them.
Click to expand...
Click to collapse
So is there a way around this or not?
yeah.. im having the same problem, i shut them all down via task manager, but after like 1 minute i go back in there and they all come back up, is there any way to make them be off permanentally till you use them again?
tbh, the way the android works, if it keeps bringing these programs back they're probably not eating up too much memory.
in fact, no matter how much crap is running in the background i've never experienced any lag or anything. makes me wonder if there's any point in killing apps, except for ones that may be constantly connected to the internet.
Meltus said:
tbh, the way the android works, if it keeps bringing these programs back they're probably not eating up too much memory.
in fact, no matter how much crap is running in the background i've never experienced any lag or anything. makes me wonder if there's any point in killing apps, except for ones that may be constantly connected to the internet.
Click to expand...
Click to collapse
Well i definitely notice a lag, although i agree with you on the applications i removed like 80% of them now just using ones i need and just installed the 1.41 everything works great. But run about 10apps let them run in the bckgs and slide the main application tab on the home screen up and down and scroll through the programs. Then kill about all apps but 3 to account for ones you need and try it again you should most likely notice a difference.
Not on lag but background processes use up battery to, I did a wipe and have like four apps on my phone: aim astro any cut and ak notepad (wow must like A's) but my battery life is noticible better than before, I can go a whole day with out having to charge vs having to charge every few hours
does anyone know of a startup manager for the G1 for EG when i reboot or start up my phone i get a lot of services and programs which i use but do not want to start on boot.
i can use task manager to close them once the phone is started but wouldt be happy for something that disables these from the start.
Has anyone found a way to modify what OEM apps boot at startup?
So using Task Manager for Root Users we get this peek into what's ?running? on our phone. or am i sadly confused..
upon initial boot and after letting the phone boot fully (about 3 minutes) i get this list in my taskmanager..
Task Manager ---not oem
Service Viewer ---not oem
MyFaves storage
Messaging
Voice Dialer
Google Talk
Maps
Calendar
Alarm Clock
Power Manager ---not oem
Missed Call ---not oem
Messaging
Phone Recorder ---not oem
MyFaves Storage
Voice Dialer
Google Talk
Maps
The list remains the same even after several refreshes..
...oddly only after killing a few tasks this is added?
Gmail
note: at this point in service viewer/tasks, only taskmanager, launcher and service viewer are present..
After killing every process through multiple refreshes messaging (which I assume is a critical app tied to the notification bar) is the only thing that remains until i load something else..
First question..are the apps listed in task manager actual hurting my battery/memory/cpu performance?
Secone question..Is there any way to auto-kill these tasks upon boot, other than by removing them? Or is there some boot.ini type file that could be editted?
sry for the long post, just curious if something can be done...
Yeah id also like to know how to manipulate what starts up on boot.
Any dev should be able to tell us.
Plenty of apps start at boot.
Seriously I would LOVE the answer to these questions. Thanks
Now while this isn't coming from a dev, when I look at the running app list I often see things I haven't touched, but they won't start unless the phone's been idle. I think what happens is it actively fills empty ram with programs so they will start faster, so I think it's just in the nature of Android.
Fushichou said:
Now while this isn't coming from a dev, when I look at the running app list I often see things I haven't touched, but they won't start unless the phone's been idle. I think what happens is it actively fills empty ram with programs so they will start faster, so I think it's just in the nature of Android.
Click to expand...
Click to collapse
yes but dont they use up cpu/memory/battery? plus i dont think the programs are so resource heavy that they would need a process running.
An answer from a Dev is what we need
I think what we need is an explaination as HOW a program can autostart on boot. If every program on my phone (stored to sd) started automatically when I turned on my phone I'll be waiting a week for it to start up. There has to be a script that these programs add to or something to run these program automatically. Either that or it's the programs themselves that are set up to start up by themselves. Where if that's the case I think we're screwed.
I'm also VERY interested in this.
Also, how to keep apps from auto-restarting once you kill them. PixelPipe has a background service that, once you start the app after reboot, it won't die. Their app support guy states otherwise tho, heh.
Also, I like how the OS says a program has "died"
I wouldn't really worry about it. For one most of those processes will be sleeping. They use no CPU time when they're in this state. Some processes register an event with the kernel and just sleep forever until that event occurs and the kernel reactivates the process. Some processes sleep for a specific amount of time, wake up and do some task, then go back to sleep. In both cases the number of CPU cycles being used are likely negligible. Most of those start-up programs will fall into one or the other category. The stuff that does take up a fair amount of CPU cycles are things like the multimedia system, the UI system, messenging, etc. In other words, the stuff you want to keep running.
Also, I wouldn't pay too much attention to those memory usage numbers. There's heavy use of shared libraries in the system. Ordinarily processes are only allowed to access memory that is allocated to them. This memory is where the process stores the bits that make up its code (stuff that doesn't change) and where it stores its working data (stuff that does change). Its actually more complicated than that but this will suffice for now. Libraries that are not shared are accessible only to the process that is using it and is stored in the memory allocated to it. Libraries that are shared can be used by multiple processes. These shared libraries are allocated to one place in RAM and when an app needs to use one of them the kernel takes care of mapping the location of the library so the app can access it as if it was in its own memory space.
The memory usage numbers you are seeing do not take into account these shared libraries. An app may be using only 1 or 2 MB of RAM but since it uses a shared library the RAM being used to hold the library is also counted and the size could be shown as 20 or 30 MB higher that what it actually is. You could kill a process and recover some memory but its probably not enough to be worth it since more than likely most of the RAM being used was in shared libraries and they'll still be there after the process is gone.
numerik, thanks for the info. But now I guess my bigger concern would have to do with this part:
Some processes sleep for a specific amount of time, wake up and do some task, then go back to sleep.
Click to expand...
Click to collapse
Similar to the problems we run into in windows. Some lame program gets added to msconfig (be it a m$ app or wicked virus), it sits there idle when you fire up your computer uses a minimal amount of cpu amd memory then does who knows what whenever it wants.

Apps starting on their own.

Apps starting on their own. Anyone have these issues? All the att stuff is gone but the video and music player are open randomly as well as quik office. I can see gmail opening and others tho check for updates
Sent from my SAMSUNG-SGH-I897 using XDA App
Yes, this annoys the hell out of me. I wish I knew what to do to stop it. I've even downloaded an app that's supposed to stop things from auto-starting, and it doesn't even work.
Search for StartUp Auditor on the market, it may work for you.
Android Market description
Startup Auditor is one of the original task killer & task manager apps. It is a boot monitor and startup monitor tool which displays a list of applications you may disable.
Terminate processes automatically.
Enable/Disable apps& keep disabled. No root.
Full version eliminates ads and can disable unlimited!
Package: com.vesperaNovus.app.StartupAuditorFree
Click to expand...
Click to collapse
On the advice of this forum I uninstalled my app killer. From time to time I use Android System to see what's running and I notice a number of apps that start themselves. These include the stock music and video players along with Slacker Radio, AT$T Maps, eBay, GPS Status and a dozen others at various times. I don't mean they remain running after exiting, I mean they start without my having used them. What could be causing these apps to start when not called upon? The ones that use GPS put a significant drain on the battery without me knowing it. Any ideas what triggers these apps? I think I'm going back to using an app killer.
Miami_Son said:
On the advice of this forum I uninstalled my app killer. From time to time I use Android System to see what's running and I notice a number of apps that start themselves. These include the stock music and video players along with Slacker Radio, AT$T Maps, eBay, GPS Status and a dozen others at various times. I don't mean they remain running after exiting, I mean they start without my having used them. What could be causing these apps to start when not called upon? The ones that use GPS put a significant drain on the battery without me knowing it. Any ideas what triggers these apps? I think I'm going back to using an app killer.
Click to expand...
Click to collapse
Mine does the same thing. I have Advanced task killer on mine. I dont use it to kill apps, just to look and see how much ram is free and whats running. But all kinds of junk opens by itself.
so does anyone have a fix for this?
derek4484 said:
Mine does the same thing. I have Advanced task killer on mine. I dont use it to kill apps, just to look and see how much ram is free and whats running. But all kinds of junk opens by itself.
Click to expand...
Click to collapse
What use is free RAM when it is kept free all the time?
AJerman said:
Yes, this annoys the hell out of me. I wish I knew what to do to stop it. I've even downloaded an app that's supposed to stop things from auto-starting, and it doesn't even work.
Click to expand...
Click to collapse
Use "start up auditor". With personal experience, this only slowed down my system.
dieselstation said:
so does anyone have a fix for this?
Click to expand...
Click to collapse
This is now android works. The way I see this, this is very much similar to "pre-fetch" concept in windows 7.
I have a 6 GB RAM laptop. Base OS uses less than 1.5 GB of RAM. But like an hour or so when I see my RAM usage, its to the tune of 3-4 GB. What I have noticed is that my most frequently/recently used apps are loaded to RAM and kept there idle. Some amount of RAM is always kept free instead of using up all RAM. This way apps start faster. When I load a different memory heavy program, it pushes the existing one out and loads this.
More or less the same in android too. When u go to any task manager app n see the running apps, u'll notice that many of the apps loaded are the ones u use frequently.
These apps do NOT use any CPU. They are just loaded to memory and kept there for quick access.
When I boot up my phone I have like 190+ MB free RAM. Though left in standy mode, within an hour, I see my free RAM fall to 80-120 MB range. I never saw it go less than 80 MB. And the apps in memory are the ones I used the last time, and the ones I use all the time.
Even if u use a task killer to kill these "inactive" apps at intervals, they would be loaded again sooner or later. That's the principle of android. So by using task killers, though u feel u r freeing up memory, in fact, u r only draining ur battery. What's the use of memory if u r not using it effectively.
Don't worry abt free RAM amount. Let android manage it. Systems are intelligent enough these days.
Hope this helps.
All well and good, but when I look at what apps are using the most resources, the GPS-enabled apps are almost always near the top of the list even when I haven't been doing anything with them. That tells me that they are stealing processor time even when not being used and that can't be good for battery usage.
Miami_Son said:
All well and good, but when I look at what apps are using the most resources, the GPS-enabled apps are almost always near the top of the list even when I haven't been doing anything with them. That tells me that they are stealing processor time even when not being used and that can't be good for battery usage.
Click to expand...
Click to collapse
Install Spare Parts and see battery usage. Do u see any GPS time under CPU usage. Though my system has all these apps loaded up, they don't show up as using CPU time or any sensors unless I use the app.
Android Memory Management
Android Memory Management
Android is a Linux based OS with 2.6.x kernel, stripped down to handle most tasks pretty well. It uses native open source C libraries that have powered Linux machines for years. All the basic OS operations like I/O, memory management, and so on, are handled by the native stripped-down Linux kernel.
How to use memory for each application
Android’s process and memory management is a little unusual. Like Java and .NET, Android uses its own run time and virtual machine to manage application memory. Unlike either of these frameworks, the Android run time also manages the process lifetimes. Android ensures application responsiveness by stopping and killing processes as necessary to free resources for higher-priority applications.
Each Android application runs in a separate process within its own Dalvik instance, relinquishing all responsibility for memory and process management to the Android run time, which stops and kills processes as necessary to manage resources.
Dalvik and the Android run time sit on top of a Linux kernel that handles low-level hardware interaction including drivers and memory management, while a set of APIs provides access to all of the under- lying services, features, and hardware.
Dalvik Virtual Machine Dalvik is a register-based virtual machine that’s been optimized to ensure that a device can run multiple instances efficiently. It relies on the Linux kernel for threading and low-level memory management.
The Dalvik Virtual Machine
One of the key elements of Android is the Dalvik virtual machine. Rather than use a traditional Java virtual machine (VM) such as Java ME (Java Mobile Edition), Android uses its own custom VM designed to ensure that multiple instances run efficiently on a single device.
The Dalvik VM uses the device’s underlying Linux kernel to handle low-level functionality including security, threading, and process and memory management.
All Android hardware and system service access is managed using Dalvik as a middle tier. By using a VM to host application execution, developers have an abstraction layer that ensures they never have to worry about a particular hardware implementation.
The Dalvik VM executes Dalvik executable files, a format optimized to ensure minimal memory foot- print. The .dex executables are created by transforming Java language compiled classes using the tools supplied within the SDK.
Understanding Application Priority and Process States
The order in which processes are killed to reclaim resources is determined by the priority of the hosted applications. An application’s priority is equal to its highest-priority component.
Where two applications have the same priority, the process that has been at a lower priority longest will be killed first. Process priority is also affected by interprocess dependencies; if an application has a dependency on a Service or Content Provider supplied by a second application, the secondary application will have at least as high a priority as the application it supports.
All Android applications will remain running and in memory until the system needs its resources for other applications.
It’s important to structure your application correctly to ensure that its priority is appropriate for the work it’s doing. If you don’t, your application could be killed while it’s in the middle of something important.
The following list details each of the application states shown in Figure (see the attached image) explaining how the state is determined by the application components comprising it:
Active Processes Active (foreground) processes are those hosting applications with components currently interacting with the user. These are the processes Android is trying to keep responsive by reclaiming resources. There are generally very few of these processes, and they will be killed only as a last resort.
Active processes include:
* Activities in an “active” state; that is, they are in the foreground and responding to user events. You will explore Activity states in greater detail later in this chapter.
* Activities, Services, or Broadcast Receivers that are currently executing an onReceive event handler.
* Services that are executing an onStart, onCreate, or onDestroy event handler.
Visible Processes Visible, but inactive processes are those hosting “visible” Activities. As the name suggests, visible Activities are visible, but they aren’t in the foreground or responding to user events. This happens when an Activity is only partially obscured (by a non-full-screen or transparent Activity). There are generally very few visible processes, and they’ll only be killed in extreme circumstances to allow active processes to continue.
Started Service Processes Processes hosting Services that have been started. Services support ongoing processing that should continue without a visible interface. Because Services don’t interact directly with the user, they receive a slightly lower priority than visible Activities. They are still considered to be foreground processes and won’t be killed unless resources are needed for active or visible processes.
Background Processes Processes hosting Activities that aren’t visible and that don’t have any Services that have been started are considered background processes. There will generally be a large number of background processes that Android will kill using a last-seen-first-killed pat- tern to obtain resources for foreground processes.
Empty Processes To improve overall system performance, Android often retains applications in memory after they have reached the end of their lifetimes. Android maintains this cache to improve the start-up time of applications when they’re re-launched. These processes are rou- tinely killed as required.
How to use memory efficiently
Android manages opened applications which are running in the background, so officially you shouldn’t care about that. This means that it closes the applications when the system needs more memory. However, most android users are not very satisfied with how it does its things because sometimes it leaves too many processes running which causes sluggishness’ in everyday performance. We can use advanced task killer/task manager and it does its job very well.
Source:
Code:
http://mobworld.wordpress.com/2010/07/05/memory-management-in-android/
Still doesn't answer the question of why the OS is starting apps randomly and without need. For instance, I have Titanium Backup and SGS Tools installed, but can't use them because I am not yet rooted. So why do I keep finding both programs started in the process list? Is the app making the call to start? If so, what can I change to stop it? Whatever Android does to manage memory, it just seems stupid for it to load programs that are hardly used without my asking it to.
Miami_Son said:
Still doesn't answer the question of why the OS is starting apps randomly and without need. For instance, I have Titanium Backup and SGS Tools installed, but can't use them because I am not yet rooted. So why do I keep finding both programs started in the process list? Is the app making the call to start? If so, what can I change to stop it? Whatever Android does to manage memory, it just seems stupid for it to load programs that are hardly used without my asking it to.
Click to expand...
Click to collapse
This is how the systems work in most systems, not just in android.
Take the new cars for instance. Power is generally sent to brakes when in low gears, though u r not actively engaging them. Why? Since u r at low speeds, higher probability of applying brakes. And when u do apply, since there is already some power already being sent, its faster to brake.
On similar lines is this principle of loading apps into memory in android too. It won't load apps to fill up ur memory. Plus the apps loaded into memory in this way don't use any CPU time (this means no battery usage). This speeds up system.
On a side note, if u feel u really do not need an app, and dont' want android loading that app, get "startup auditor" from market. Select the apps u don't want to persist in memory and don't want to auto start. Beware of one thing here: if u make an app as 'do not persist' in memory, and that app is started manually or by any other app, it would be killed giving FC in the app that's using it.
Note: I coined the term 'do not persist'. I do not have the app anymore to check for the exact term.
Edit: In windows, this pre-fetching is done through a service. And one can disable that service, though not recommended. I am not sure if this is done through a service that is "stoppable" in android.

[GUIDE] Improve Your Android User Experience and Multitasking

How Android manages Memory
Android groups all apps into 6 groups, from highest priority to lowest:
Foreground app - you see this app on screen, currently running, but also includes the system itself and "phone"
Visible app - the app is running and visible, but due to multi-tasking or such is not currently "on top"
Secondary server - services that stay in background and apps such as Launcher (or other home replacements). Most services go here, like music player, clock updater, background sync, and so on, that's not built into the OS.
Hidden Application - apps not visible, but still running in the background
Content Provider - process that provides content to the foreground, such as "contacts content provider", "calendar content provider", and so on. May also known as "storage".
Empty App - the app is in standby, not being used, but is still in memory.
How to manipulate this to get the best performance
We can manipulate our OOM values for each of these categories using the app "System Tuner Pro" (not sure if it works with the free version or not) or "Auto Memory Manager", there may be others too. After installing from the market, open it and click on "Memory" - you will then be able to change OOM values. Having a lower OOM value for a category, means android will wait longer until killing apps from that group.
From what I have experienced, the more open apps in the "Empty App" category, the slower and more sluggish the phone. Having these apps open is basically a waste of memory, because they are in standby and not being used. A high OOM value should therefore be set for "Empty App".
Processes that fall into the "Content Provider" category are also a waste of space; they only actually get used when running the application that service belongs to. This means that often the service will be running in the background when it doesn't actually need to be. A high OOM value should therefore be set for "Content Provider".
The other four categories all contain apps actually being used by the user. When multitasking you want these apps to stay open. A low OOM value should therefore be set for "Foreground App" "Visible App" "Secondary Server" and "Hidden Application"
Doing this is similar to what the SuperCharger Script does, but in my opinion this solution is simpler to implement and easier to change depending on the users needs.
I have attached a thumbnail of my setup, but everyone uses their phone differently so you may want to alter some of the values.
Click Thanks if you tried this and it helped!
BUMP
Thanks for the guide, trying this out to see if I notice some improvement in my phone.
how do you get the values to stick? I duplicated what you did and backed out and the original presets came back after a reboot. I did not see a "save" option. thanks.
steve austin said:
how do you get the values to stick? I duplicated what you did and backed out and the original presets came back after a reboot. I did not see a "save" option. thanks.
Click to expand...
Click to collapse
After applying the limits, there's a button at the bottom of the page called boot settings.
On the menu this takes you to, click reapply memory settings and then check on boot completed
Sent from my HTC Sensation using XDA
sorry for the noob question, but are u sure its not the other way around? i mean, setting a higher value would mean the app is going to stay running in the background for a longer time?
alireza_simkesh said:
sorry for the noob question, but are u sure its not the other way around? i mean, setting a higher value would mean the app is going to stay running in the background for a longer time?
Click to expand...
Click to collapse
I had this EXACT same initial thought. However, once I stepped back and looked at it again, I realized that he is correct in what he originally posted.
What the high values in his screenshot are basically saying is "When I get to less than 256mb free memory, I am going to dump all the applications of this type" and the low values are basically saying "When I get to only 3mb of free memory then I am going to dump all the applications of this type."
So if you set it HIGH like the original poster said then it will dump those out of memory faster than if you set them to 100mb because then you'd have to have more things filling up memory before they would be dumped.
Hopefully that clears things up a little for you (and others who I'm sure will have the exact same question).
-- Zeustopher
Zeustopher said:
I had this EXACT same initial thought. However, once I stepped back and looked at it again, I realized that he is correct in what he originally posted.
What the high values in his screenshot are basically saying is "When I get to less than 256mb free memory, I am going to dump all the applications of this type" and the low values are basically saying "When I get to only 3mb of free memory then I am going to dump all the applications of this type."
So if you set it HIGH like the original poster said then it will dump those out of memory faster than if you set them to 100mb because then you'd have to have more things filling up memory before they would be dumped.
Hopefully that clears things up a little for you (and others who I'm sure will have the exact same question).
-- Zeustopher
Click to expand...
Click to collapse
Yes that's exactly right, sorry I should have probably explained that a bit better initially.
Zeustopher said:
I had this EXACT same initial thought. However, once I stepped back and looked at it again, I realized that he is correct in what he originally posted.
What the high values in his screenshot are basically saying is "When I get to less than 256mb free memory, I am going to dump all the applications of this type" and the low values are basically saying "When I get to only 3mb of free memory then I am going to dump all the applications of this type."
So if you set it HIGH like the original poster said then it will dump those out of memory faster than if you set them to 100mb because then you'd have to have more things filling up memory before they would be dumped.
Hopefully that clears things up a little for you (and others who I'm sure will have the exact same question).
-- Zeustopher
Click to expand...
Click to collapse
Yea i get it now.
the program developer must make the interface a bit more clear
thanks. I will apply it today and see what happens.
Notification improvement in smoothness in UI.
But setting too high minfree in empty application cause alot of launcher redraw.
cwk_and said:
Notification improvement in smoothness in UI.
But setting too high minfree in empty application cause alot of launcher redraw.
Click to expand...
Click to collapse
That's odd, the launcher usually sits in visible or secondary server... what launcher are u using?
Sent from my Sensation using XDA
I am using Auto Memory Manager for this, thanks for the write up.
mf2112 said:
I am using Auto Memory Manager for this, thanks for the write up.
Click to expand...
Click to collapse
No worries
Didn't know that app existed, will add it to the guide thanks!
I applied your settings to see what happens.....I hqve a question for you. In cm9 and aokp there is setting for Max background process limit.....would you suggest any modification here as well?
dmeinder said:
I applied your settings to see what happens.....I hqve a question for you. In cm9 and aokp there is setting for Max background process limit.....would you suggest any modification here as well?
Click to expand...
Click to collapse
You could give it a shot and see if it helps but I doubt it will. If anything, it will limit multitasking because apps will get closed before OOM values are reached.
Hope that helped
Sent from my Sensation using XDA
this is nice trick but it realy save battery and perfom cpu.
As far as I have heard oom values are not these memory settings you mention. OOM is a specific value for each app. The lower it is, the less prone the system is to kill it off.
I have System Tuner pro but couldn't find how to change the oom value. Only app that could change it is autokiller and those settings don't stick or even work.
My memory settings are killing off some apps that I would like to keep in memory.
making empty app so high means no multitasking at all it will kill almost every app once you exit it, tried these and as sson as i leave browser it closes itself, for multitaskers use 45 for hidden, 70 for content provider, 85 for empty app, do not set it lower than 85 or you may encounter a lag that you can't get rid without taking the battery off because you won't be able to close an appliation with that lag. By the way other three values are not that important set them 7-15-20 no problem at all.
Tom200 said:
As far as I have heard oom values are not these memory settings you mention. OOM is a specific value for each app. The lower it is, the less prone the system is to kill it off.
I have System Tuner pro but couldn't find how to change the oom value. Only app that could change it is autokiller and those settings don't stick or even work.
My memory settings are killing off some apps that I would like to keep in memory.
Click to expand...
Click to collapse
I don't know what ur on about, the tweaks in system tuner pro are for OOM values.
You need to do some more research mate.
Sent from my Sensation using XDA

[Q] Task Manager

So with the OTA ICS update, I noticed that the stock task manager that was on gingerbread has been removed. Does anyone know why that is, and is it recommended to use any of the market task managers? The reason I ask is sometimes I forget to close things like maps or navigation, and I usually set it up to kill the task once my screen locks to save battery.
A common misconception is that apps run in the background forever; this is not true. If an app is using too much memory (which links to battery life) it’ll be killed by your phone. That’s why if you play a game, check a message, and come back the game is still running. It’s memory usage isn’t that high. However if you put your phone down, walk away for an hour, and the game is still trying to run in the background, there’s a good chance it will be closed before you come back. Separate task managers have to constantly be running in the background which can actually use more battery than it saves. Yes, task managers can use more battery than claim to save.
Long press the home button. Swipe left or right to close out an application. Or, if you're really concerned about this, under Settings -> Developer options, there is a setting under the APPS category called Don't keep activities. It says that selecting it will "destroy every activity as soon as the user leaves it." Also, you can limit your background processes there as well.
Sent from my rooted Mayan Calendar
Just wanted to add, while the task manager has disappeared explicitly as an app, as Apex rightly pointed out ICS is more dynamic in it's task & app management since being a upgraded iteration of the Android OS. Also whilst the further useful tips what Apex has advised, bear in mind the swipe to end action will never show background processes & tasks, rather it shows only running main non system apps. Also since practically everyone makes use of a file manager like Astro you also have a task manager (which is an inbuilt function of the program) which you can make use of. Similarly Avast too has an inbuilt task manager. Also many apps have internal setting to disable feature of autostart while rebooting which you may want to look at. I kind of feel also a lot of apps have got work to do in terms of coming to speed with seamless ICS cohabitation until which point of time they misbehave at times.
A thing which I miss is, earlier when we used to hit the home button it would revert to the third home page out of the five and if pressed once again all the five home pages would float simultaneously but I believe this functionality has been discontinued now.

Any task manager that actually works?

Hi!
I have tried various task managers from play store. They all show either nothing or just few app. Mostly they dont even display stuff that is running such as Firefox.
Sofar the only task manager that works for me is:
Code:
su -
top
But the problem is that it my phone has so many processes working that they dont all fit in one screen, and since top command is constantly updating, it scrolls back down. So I have to Ctrl - C to interrupt and then write kill -9 pid which is a bit annoying.
Is there any simple task manager out there that is graphical version of top command and that shows me absolutely everything, not only stuff that is currently active? To me it's important to see cpu usage next to pid.
sysctl said:
Hi!
I have tried various task managers from play store. They all show either nothing or just few app. Mostly they dont even display stuff that is running such as Firefox.
Sofar the only task manager that works for me is:
Code:
su -
top
But the problem is that it my phone has so many processes working that they dont all fit in one screen, and since top command is constantly updating, it scrolls back down. So I have to Ctrl - C to interrupt and then write kill -9 pid which is a bit annoying.
Is there any simple task manager out there that is graphical version of top command and that shows me absolutely everything, not only stuff that is currently active? To me it's important to see cpu usage next to pid.
Click to expand...
Click to collapse
No, task managers are crap, the native task killer that android has built in works fine. 3rd party task killers actually make the device work harder because they constantly reload the tasks that you kill.
Best option is root your device then uninstall unnecessary system apps, and use Greenify to freeze your other apps when they aren't in use.
All task managers, RAM savers, optimizers and battery savers are all junk, they actually do the opposite of what you think they do.
I DO NOT PROVIDE HELP IN PM, KEEP IT IN THE THREADS WHERE EVERYONE CAN SHARE
Dunno how with Android, but actually the 'top' command can be configurated to di what you want. Just read the top man page.
Sent from this galaxy
Clean Master is a good one. I got it mainly for it's ability to clear junk files, but the ram boosting ability is handy as well every now and then. It also has a mode that let's you launch games in "boosted" mode, which I think is just a clearing a ram when launching the game. Not sure if it maintains that or just just does a task kill at launch. Killed apps can often just restart soon after. Incidentally, I do that a lot for Iron Man 3.
ABSarah said:
Clean Master is a good one. I got it mainly for it's ability to clear junk files, but the ram boosting ability is handy as well every now and then. It also has a mode that let's you launch games in "boosted" mode, which I think is just a clearing a ram when launching the game. Not sure if it maintains that or just just does a task kill at launch. Killed apps can often just restart soon after. Incidentally, I do that a lot for Iron Man 3.
Click to expand...
Click to collapse
No, Cleanmaster is not a good one, none of the task killer/RAM optimizer apps are "good" they are actually counterproductive and make your device work harder in the long run.
Sent from my LGL84VL using Tapatalk
Instead of using a task manager that will probably not work, try Kernel Adiutor and try setting the Low Memory Killer to your wishes, following this guide.

Categories

Resources