Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android.os.MessageQueue.next taking up the plurality of exclusive time -- is this normal behavior?

I've recently run a method tracing session on the process of opening a FragmentActivity that takes about 750-1000ms to open from the previous activity and has a ListView into which it loads its initial batch of data in times that vary from as low ("low") as 1500ms to as high as 5000ms. After sorting by "exclusive time", I noticed that a method named android.os.MessageQueue.next is taking up the plurality of the time.

A view of all the main thread after a method tracing session. Notice android.os.MessageQueue.next is first in the list:

A view of all the threads after a method tracing session

Now, my question is as such: is this standard operating procedure in an Android app--that is, does android.os.MessageQueue.next refer to the main queue waiting for another operation? Or, alternately, could this indicate some sort of temporary deadlock?

Should I be worried?

like image 267
Dennis L Avatar asked Feb 03 '15 16:02

Dennis L


1 Answers

If you are using a handler thread hopefully something went wrong. I could see these lines in source code of MessageQueue's next method. Have a look it may help you to understand.

** Message next() { // Return here if the message loop has already quit and been disposed. // This can happen if the application tries to restart a looper after quit // which is not supported. **

Source code

like image 146
siva Avatar answered Nov 14 '22 09:11

siva