Debugging: Detecting that UI thread is blocked?

Debugging: Detecting that UI thread is blocked?

Update: The source for my quick and dirty MonitorUIResponse:

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. 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.

  2. 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 🙂 )

  3. 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