CREDIT: http://is.gd/7JpR2c
I see this come up over and over again. People saying that a task is running in the background and they think it is killing their battery or hogging all of their memory. So their natural reaction is to download a program made to kill tasks. Here’s the thing… you are likely doing more harm than good by killing tasks that aren’t ready to end. I was the same way when I first got my CDMA Hero. There were tons of things running that I didn’t want so I just kept killing them. After a few weeks I realized that if I stopped using a task killer (and totally uninstalled it in fact) my phone actually began to run better! The applications would close themselves and things just seemed to be running better. I get that there may be short term benefits from clearing a task, but you should still take the time to read through this.
Here is some information directly from Android’s developer page. I have put the important parts in bold. This is quite a lengthy read but honestly I think it’s important.
By default, every application runs in its own Linux process. Android starts the process when any of the application’s code needs to be executed, and shuts down the process when it’s no longer needed and system resources are required by other applications.
A content provider is active only while it’s responding to a request from a ContentResolver. And a broadcast receiver is active only while it’s responding to a broadcast message. So there’s no need to explicitly shut down these components.
Activities, on the other hand, provide the user interface. They’re in a long-running conversation with the user and may remain active, even when idle, as long as the conversation continues. Similarly, services may also remain running for a long time. So Android has methods to shut down activities and services in an orderly way:
An activity can be shut down by calling its finish() method. One activity can shut down another activity (one it started with startActivityForResult()) by calling finishActivity().
A service can be stopped by calling its stopSelf() method, or by calling Context.stopService().
Components might also be shut down by the system when they are no longer being used or when Android must reclaim memory for more active components.
If the user leaves a task for a long time, the system clears the task of all activities except the root activity. When the user returns to the task again, it’s as the user left it, except that only the initial activity is present. The idea is that, after a time, users will likely have abandoned what they were doing before and are returning to the task to begin something new.
Click to expand...
Click to collapse
Activity lifecycle
An activity has essentially three states:
It is active or running when it is in the foreground of the screen (at the top of the activity stack for the current task). This is the activity that is the focus for the user’s actions.
It is paused if it has lost focus but is still visible to the user. That is, another activity lies on top of it and that activity either is transparent or doesn’t cover the full screen, so some of the paused activity can show through. A paused activity is completely alive (it maintains all state and member information and remains attached to the window manager), but can be killed by the system in extreme low memory situations.
It is stopped if it is completely obscured by another activity. It still retains all state and member information. However, it is no longer visible to the user so its window is hidden and it will often be killed by the system when memory is needed elsewhere.
If an activity is paused or stopped, the system can drop it from memory either by asking it to finish (calling its finish() method), or simply killing its process. When it is displayed again to the user, it must be completely restarted and restored to its previous state.
The foreground lifetime of an activity happens between a call to onResume() until a corresponding call to onPause(). During this time, the activity is in front of all other activities on screen and is interacting with the user. An activity can frequently transition between the resumed and paused states — for example, onPause() is called when the device goes to sleep or when a new activity is started, onResume() is called when an activity result or a new intent is delivered. Therefore, the code in these two methods should be fairly lightweight.
Click to expand...
Click to collapse
The following diagram illustrates these loops and the paths an activity may take between states. The colored ovals are major states the activity can be in. The square rectangles represent the callback methods you can implement to perform operations when the activity transitions between states
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
So… the TL;DNR Version:
Android is hard coded to automatically kill a task when more memory is needed.
Android is hard coded to automatically kill a task when it’s done doing what it needs to do.
Android is hard coded to automatically kill a task when you haven’t returned to it in a long time.
Most services (while possibly running in the background) use very little memory when not actively doing something.
A content provider is only doing something when there is a notification for it to give. Otherwise it uses very little memory.
Killing a process when it isn’t ready only causes it to have to reload itself and start from scratch when it’s needed again.
Because a task is likely running in the background for a reason, killing it will only cause it to re-spawn as soon as the activity that was using it looks for it again. And it will just have to start over again.
Killing certain processes can have undesirable side effects. Not receiving text messages, alarms not going off, and force closes just to name a few.
The only true way to prevent something from running at all on your phone would be to uninstall the .apk.
Most applications will exit themselves if you get out of it by hitting “back” until it closes rather than hitting the “home” button. But even with hitting home, Android will eventually kill it once it’s been in the background for a while.
Questions? Concerns? Feel that I’m wrong? Comment below and let’s discuss!
Addendum:
One thing that I forgot to even address here is that memory works a bit differently in linux than it does in Windows. In general the way memory works is you really only need as much as you plan on using. So if your combined running programs use 100mb of memory, 150mb is more than enough. There is no need to clear what’s running in memory before you hit that 150mb cap. Now in Windows it seems that the system performs a bit better when you have less stuff in memory, even if it’s not full. No doubt those who have been on computers for a while will remember there used to be programs that could clear your memory in Windows also.
Linux however isn’t generally affected by this. While I admit that I don’t know the architecture and reason for this… linux will run the same regardless of if you have 20mb free memory or 200mb. And as I outlined above, Android will automatically start to kill applications if you do get low on memory! Stealing a quote from Chris Johnston, “Buffers and cache in RAM being cleared is silly. Imagine a professor, who rather than writing all the way across the chalkboard, finishes a sentence and immediately erases and starts writing in the upper left corner AGAIN and AGAIN and AGAIN OR imagine you like a song. You record it to the beginning of a cassette tape. When you want a new song, do you re-record over the first song or record after it?”
I have also seen people incorrectly assume that the more memory in use, the faster their battery will die. This would actually be more attributed to the amount of processor cycles (CPU %) going on and not the amount of memory being taken up by a certain program. However, that does lead to a good point! When can a task manager be a good thing? To help you determine what IS slowing down your phone; what may actually be draining your battery faster. While an item using up memory isn’t going to hurt things, an item chewing through your CPU absolutely will. Now I still don’t suggest using a task killer to kill a program that is using up your processor (unless of course it is a zombie process that is going crazy, but you should probably just reboot in that case). But it can help you see what’s going on with your phone. A Task Killer will not ever help you're battery life unless it is killing a poorly-coded app that is always running and eating CPU Cycles, and in that case, you should uninstall that app!
I hope this has helped someone. With all of that said… I always encourage experimenting. It is your phone, and you can do with it what you please. If you swear that a task killer makes your phone amazing, then by all means use it, but know that you're lying to yourself!
Thanks for reading.
Good post, thanks. It's about time people realised that the paradigm has changed and Task-Killers are a part of the problem, not the solution.
Excellent Post ! Glad I am not the only one beating the drum on task killers being pointless. What is interesting a lot of devs will preload them in their roms....... and Then I have to delete them 1st thing.
Thanks, for the post
What about certain apps like Skype, where its not possible to sign out of the app, it keeps running once started!
much thanks, [inserting generic cop compliment] you're a real credit to the force!
icebuck said:
What about certain apps like Skype, where its not possible to sign out of the app, it keeps running once started!
Click to expand...
Click to collapse
I thought the same thing. What you have to do is click the My Info tab, then under where it says Status is should say Online - Change Status. Click that. Then click Sign Out. This will log you out, then you can exit Skype.
There you go!
thats good ! thank you for image !
Thanks for the post. Great information. Good to know.
What about the Battery Drainage though? The more Apps Running, the Faster the Battery Dies... I get the part about phone memory but that Wouldn't Control the Battery Life Would it? Correct me if I'm Wrong!
*Sent on My*
Fast as its Ever Been....
"Sprint" Hero.... Running My, *ExEnHeroC* Rom, w/Kifno's Twist, Also The XDA-BLUE.apk!! "Page 10" of My Thread!!
http://forum.xda-developers.com/showthread.php?t=957867
http://www.megaupload.com/?d=WTMLMK6M
http://www.mediafire.com/?bb1axugm0bw7oro
http://m.youtube.com/index?desktop_uri=/&gl=US#/profile?user=PMGRANDS
Use auto killer, case dismissed.
Sent from my HTC Vision using XDA App
Wife was complaining about HTC Incredible acting stupid. Removed task killer and she hasn't complained since.
I have the same question as others, but what about the battery issue? If a task is running in the background and is for some reason CPU intensive, it wastes battery and I don't want it to.
jamtown85 said:
I have the same question as others, but what about the battery issue? If a task is running in the background and is for some reason CPU intensive, it wastes battery and I don't want it to.
Click to expand...
Click to collapse
I would think that either one of two things is happening:
1) The CPU-intensive app is doing something you want, so you don't want to kill it.
2) The CPU-intensive app is doing something completely useless, so you either should just disactivate the mode that chews up CPU resources or just delete the app altogether.
Having to use an app-killer because an app is burning up the CPU means that you need to manage your apps better or get better apps that are more suited for use on an energy-frugal mobile platform.
FYI, I'm using JuiceDefender to help conserve battery life. It does things like intelligently toggling off and on wifi and 3G receivers, adjusting the brightness, etc. It doesn't kill apps. If you really want battery extender, get something like this.
will try JuiceDefender
The programs staying in memory won't use CPU when they are in background, but when the Task Killer kills these processes it does utilize CPU, hence battery. So that's a valid point. Good post.
PMGRANDS said:
What about the Battery Drainage though? The more Apps Running, the Faster the Battery Dies... I get the part about phone memory but that Wouldn't Control the Battery Life Would it? Correct me if I'm Wrong!
*Sent on My*
Fast as its Ever Been....
"Sprint" Hero.... Running My, *ExEnHeroC* Rom, w/Kifno's Twist, Also The XDA-BLUE.apk!! "Page 10" of My Thread!!
http://forum.xda-developers.com/showthread.php?t=957867
http://www.megaupload.com/?d=WTMLMK6M
http://www.mediafire.com/?bb1axugm0bw7oro
http://m.youtube.com/index?desktop_uri=/&gl=US#/profile?user=PMGRANDS
Click to expand...
Click to collapse
You see, most applications (except for crappily coded ones), even if running in the background, will not use any CPU cycles, therefore, not using any battery.
Related
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. 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.
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.
I found an application named AutoKiller Memory Optimizer by which applying its tweaks It makes my phone more smoothly and saves my battery very well!
There are some reviews below links:
http://forum.xda-developers.com/showthread.php?t=622666
http://andrs.w3pla.net/autokiller
http://andrs.w3pla.net/autokiller/details
http://andrs.w3pla.net/autokiller/kernel
If anyone has installed this application plz give your opinion !
Task killers are pointless, just use Autostarts and Greenify.
That combo will be far more efficient
It's not a regular task killer! I suggest to try it!
Listy2021 said:
Task killers are pointless, just use Autostarts and Greenify.
That combo will be far more efficient
Click to expand...
Click to collapse
It's not a regular task killer! I suggest to try it!
ehsan453 said:
It's not a regular task killer! I suggest to try it!
Click to expand...
Click to collapse
Yes it is, it's just filled with other guff to make it look more advanced or whatever
Listy2021 said:
Yes it is, it's just filled with other guff to make it look more advanced or whatever
Click to expand...
Click to collapse
You have not test it yet, therefore you can't understand what i mean!
ehsan453 said:
You have not test it yet, therefore you can't understand what i mean!
Click to expand...
Click to collapse
How do you know I haven't tested it before?
The whole reason I can make a judgement on task killers (including this one) is that before using Autostarts & Greenify I tested other options, therefore my opinion is valid :good:
Listy2021 said:
How do you know I haven't tested it before?
The whole reason I can make a judgement on task killers (including this one) is that before using Autostarts & Greenify I tested other options, therefore my opinion is valid :good:
Click to expand...
Click to collapse
It's not a task killer. It's an app that modify your lmk and add some tweaks. But you can kill some apps from this app.
What is so special about this task killer? No, I am not gonna test it.
Vit5000 said:
What is so special about this task killer? No, I am not gonna test it.
Click to expand...
Click to collapse
First Plz read reviews in first post and also these two reviews:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Releasing RAM With Autokiller Memory Optimizer
Have you ever wished to speed up your Android, but now known how? Have you tried task killers, but found it hard to tell whether you made an improvement? In this post, we’ll look at Autokiller Memory Optimizer, an app that gives you more control over how Android releases its system resources.
“You shouldn’t be using a task killer with Android” clearly explains why the task killers are not a good solution to fasten up your system in the Android interface. Briefly, we might say that the reason that task killers are no good for Android is that the same system regulates itself for releasing RAM memory. Process are not killed when you close the app; instead the process stays open until the system itself realizes it needs more memory to run a new process. This way, you can actually gain some speed when you restart the app, as its resources may still be in memory.
Just like a computer, a smartphone uses Random Access Memory (RAM) for processing the functionality of softwares and apps. When you are running low on RAM, your phone will start to slow down, because it needs more memory than is available. As a solution to this problem, Android devices has an autokiller that automatically shuts apps down when the memory used is close to the limit. Obviously this limit depends on the capabilities and configuration of your phone.
If you root your phone (and I totally recommend you to do that) you can use apps for changing your system parameters like the RAM auto killing. One of this apps is Autokiller Memory Optimizer available on the Android Market.
As the developer says: “AutoKiller Memory Optimizer is designed to fine-tune Android system’s inner memory manager routines to keep your device fast and smooth. It also features a full-powered process manager which lets you control your whole system.”
Warning: Messing around with system configurations like this is potentially dangerous to your phone, and not for the faint-hearted! Check out our other How To articles for safer tips on improving performance.
Going for It
The system itself divides the process into six different types, and here’s where it gets technical. The six types are as follows.
FOREGROUND_APP: This is the process running the current foreground app. We’d really rather not kill it! Value set in system/rootdir/init.rc on startup.
VISIBLE_APP: This is a process only hosting activities that are visible to the user, so we’d prefer they don’t disappear. Value set in system/rootdir/init.rc on startup.
SECONDARY_SERVER: This is a process holding a secondary server — killing it will not have much of an impact as far as the user is concerned. Value set in system/rootdir/init.rc on startup.
HIDDEN_APP: This is a process only hosting activities that are not visible, so it can be killed without any disruption. Value set in system/rootdir/init.rc on startup.
CONTENT_PROVIDER: This is a process with a content provider that does not have any clients attached to it. If it did have any clients, its adjustment would be the one for the highest-priority of those processes.
EMPTY_APP: This is a process without anything currently running in it. Definitely the first to go! Value set in system/rootdir/init.rc on startup. This value is initialized in the constructor, careful when refering to this static variable externally.
For every type of app, the system has a limit of pages (1 page=4 kilobytes) predefined. Autokiller Memory Optimizer allows you to modify this.
For the changes you can make you have the freedom to set as you wish, but there is a lock on the three first types of apps (this can be removed in the Preferences tab) and there isalso a list of presets configuration as follows (the numbers corresponds to megabytes remaining before shutting apps in the last 3 types of apps): Moderate (30, 35, 40), Optimum (40, 50, 60), Strict (60, 70, 80), Aggressive (82, 90, 98), Extreme (150, 160, 170), Ultimate (200, 225, 250) and (a wink from the developer about the TV series) Lost (4, 8, 15, 16, 23, 42).
Autokiller presets
Within these presets, you should try different ones, because every phone has its own RAM capacity and it would not be a good idea to set a killing parameter that is very close to your RAM total capacity as your phone would be killing apps constantly and you wouldn’t be able to use it at all.
Processes list
The app also categorizes the running apps in the six types and you can kill them manually for RAM release in the tab processes and the same occurs with the services in the current tab.
Services list
This app has also a donate version with some more features like the Chuck Norris mode when you can configure the app to use aggressive killing to release memory. It also gives the ability to set a different preset when the screen of the phone is off (this is very useful because when the screen is off you do not need memory to run new apps, but it still consumes battery).
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Tweak your system thanks to AutoKiller Memory Optimizer
Summary
Relax, I’m not trying to fool you into thinking that a task killer is really a tweak. Don’t be fooled by the ‘AutoKiller’ part of the app’s name, focus on the other words instead, because AutoKiller Memory Optimizer will allow you to fiddle around and make a few adjustments. Read on and find out what kind of adjustments I’m talking about, and whether the app is worth your time.
Features & Use
AutoKiller Memory Optimizer is there to help you bring your system up to par by conducting a bit of fine tuning. The app comes with a task manager. Use the task manager to get rid of lagging processes, the logic behind this being that if you’ve got something running that’s not really doing anything useful, but does consume 98% of the CPU as well as a hefty chunk of memory you should really unload energy hoggers. Your system will thank you by running smoothly. The task manager also displays the oom_value for ever app—more details below.
The app allows you to regulate the settings for the OOM killer, the automatic killer integrated in every Android device whose role it is to create more memory space wherever possible. As you know, in the Android world applications are never halted or shut down, they are merely rendered inactive—until the memory pipes up and the Out Of Memory Killer rears its head. But when does memory shortage become critical? And who decides which apps should be banished, and when should this occur? If you want to make these types of decisions yourself take a look at AutoKiller Memory Optimizer.
Android divides running apps into six categories ranging from the app that you’re currently working with to ‘empty apps’ (i.e. apps that you left by hitting the back button at some point). Once RAM space becomes too low the OOM killer will start by banishing said empty apps, and, if need be, continue working its way up. AutoKiller Memory Optimizer lets you decide how much free RAM space is required for your device run smoothly. There are different presettings to pick from (‘moderate’, ‘aggressive’, etc) and you can check out the developer’s website to read up on user experiences.
Bottom line:
AutoKiller Memory Optimizer affords you easy access to essential systems settings, allowing your Android to perform as optimally as possible. How essential this kind of app is is contingent on lots of factors: which device you’re working with, how good the manufacturer’s presettings are and what can be done to adjust them.
Screen & Controls
AutoKiller Memory Optimizer is set up in a very logical way. While high skilled, expert knowledge of Android isn’t essential in order to get the best performance out of the controls, it doesn’t hurt to have some experience. You can find in depth information and details regarding the settings options on the developer’s website, which means that you really don’t need much background knowledge in order to get something out of this app.
If you have a bit of experience you will find that the app’s controls are intuitive; if you’ve never worked with tweaking before I recommend that you give this app a miss.
Speed & Stability
AutoKiller Memory Optimizer is fast, stabil and dependable. I’ve been using the app for just over a month and it hasn’t crashed once so far.
EDIT: repeated
This actually helps very much with memory management. I've been using it alongside Greenify and Autostarts for several months now.
Those individuals banging on about it being just another task manager clearly did not use this app as it is intended to be used.
Sent from ThePureHeart's I9300 Boss Edition
If i use the "ultimate" preset, will it drain my battery faster?
AzizWahid said:
If i use the "ultimate" preset, will it drain my battery faster?
Click to expand...
Click to collapse
Best preset is optimum
Its 2018 now. Is it still useful?
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.