Debugging: Detecting that UI thread is blocked?

Debugging: Detecting that UI thread is blocked?

Update: The source for my quick and dirty MonitorUIResponse:

https://drive.google.com/file/d/0B1MyXorVzay9ZjFJc3B6VjI3MUU/view?usp=sharing

Does anyone know of a tool or method that can monitor and log the responsiveness of a UI?  I.e. flag occasions where the app is in “Not responding” mode for a period of time (1 sec or more) ?

I’m trying to track down a strange “lagginess” which doesn’t directly reflect in the debug out log.

27 thoughts on “Debugging: Detecting that UI thread is blocked?


  1. Uwe Raabe I noticed but haven’t used that “check for frozen main thread” madExcept option. How would it do if it has detected a the main thread’s frozen?


  2. Lars Fosdal nice project, the icing in the cake would be to log the thread(s) stack trace to guess the reason, but anyway, just a breakpoint there is a wonderful tool


  3. David Berneda I have a detailed timestamped debug log from the app I’m monitoring, so that will give me a pretty good idea. I’ve already seen stutter where I expected none, and we’ve done some changes to what is pre-cached in the db, and what is done on the fly. The main thing is that I can drop this in with a real user, working on live data and get objective information on the performance, instead of the rather vague and subjective opinion of the users.


  4. Lars Fosdal I think it would be nice to log the stack trace when the GUI is busy (hangs)? I think I can make that part with my AsmProfiler (my sampling profiler already can fetch the stack of an external explication, when you have debug symbols ofcourse 🙂 )


  5. André Mussche You have my “go ahead” for creating your own version of this, and add the stack trace. It would indeed be neat.


  6. I’ve sanitized the comment list, removing the back and forths on error checking. As much as I enjoy having my imperfect code analyzed, it was strictly off topic.


    Let’s just agree that error checking is a good thing. If anyone find my quick and dirty code sample lacking checks, please take care to add them before use.

Leave a Reply