If an application becomes unresponsive at any time, the window server notifies the user of this situation by changing the cursor to a spinning wheel. If your application is the one that is unresponsive, sampling it during that time can help you determine why it is unresponsive. However, even if you have Shark or another tool ready to go, you might not be able start them fast enough to gather a set of samples during the unresponsive period. This is where Spin Control provides a helpful solution.
Spin Control is a monitoring tool that automatically samples unresponsive applications. You leave Spin Control running on your computer whenever you are testing your application. When the spinning cursor appears, Spin Control gathers the backtrace information and makes it available from the application’s main window, as shown in Figure 4-2.
To view the backtrace for a particular session, select that session and click Open. Spin Control displays the browser window (Figure 4-3) along with the sample data. You can use the data in this window to identify the code that was executing when your application became unresponsive. The controls in the bottom-left corner of the window let you change the way you view the samples. The buttons at the bottom right let you prune the call stacks and focus on the most relevant call stack entries.
If you want to view a complete listing of the call stacks, click the “Show text report” button on the main window. This format shows a formatted version of the entire data set that you can copy and paste into other documents.
Last updated: 2006-10-03