It's a little more complicated than that. 2% of CPU usage in the background with the CPU running at normal speed is a *lot*.
And really, an app in the background shouldn't be using any CPU. If it is sitting there blocked waiting for something to do, it won't use any CPU. The only reason it would use CPU is because it is waking up for some reason to do something. Another wrinkle is that Android devices aggressively scale the CPU, so 2% of an essentially idle CPU may be a lot smaller because the CPU is running at that point at a much lower frequency. At any rate, my suggestion for debugging this is to run the profiler on your app when it is in the background and look at what it is doing during that time. On Mon, Oct 31, 2011 at 11:08 PM, Kristopher Micinski < [email protected]> wrote: > On Tue, Nov 1, 2011 at 2:01 AM, imran ali <[email protected]> wrote: > > Thanks Kris, > > yes, i am not using any thing either service or background thread > > computation, but still it has been > > consuming approx 2% CPU, i have been looking it through another > > application "Android assistant". > > > > is there any way to know running thread of application from eclipse? > > so that i can understand that, which thread is running and using CPU. > > > > Regards > > imran ali > > > > Imran, > > Don't worry about this at all. 2% background usage is completely > normal and fine. Your app is running always running some code: > because your app is actually an instance of a vm which is processing > messages on a looper. So even if your app isn't doing intensive > processing, it's constantly checking to see if it got new messages, > doing gc, and related background things. > > The same goes for any desktop application. Open up your task manager > or run "top" on a linux box: you'll see tons of processes using ~1-2% > of the cpu time, it's completely normal application behavior. > > kris > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

