Analyze Wait Chain - Why is my program stuck?
My new favorite "Nerd" feature in Win7 involves the Resource Monitor (not surprisingly.) It's mesmerizing at times...
Ever had a program get "stuck", where it seems to be quite obviously waiting for something, but you don't know what? Install programs that invoke child processes are notorious for this.
In the Win7 Resource Monitor app, in the Overview or CPU tabs, you'll find the list of running processes. If a process is "stuck", it'll be highlighted with red text. This isn't the cool part though.
You can right click on any process, and in the context menu, you'll see "Analyze Wait Chain...". Click that. In a nutshell, it lists the threads in a process that are blocking on a resource currently owned by another process. Better still, it tells you who the owning process/thread is! With that info, you can take corrective action, such as killing the child process that's not giving up the resource.
My favorite Windows 7 feature so far - Resource Monitor
While the Windows 7 UI is currently getting most of the "What's new?" attention, I'm a system guy at heart. I gravitate towards the tools and features that let me understand what's going on. Why does program 'X' take so long to load? Which of my dozens of services are sucking up the CPU? Which app is pounding on the network connection?
With the Windows 7 Resource Monitor, it's trivial to get answers to these sorts of questions. If you're familiar with SysInternals tools like ProcMon and ProcExp (and if not, you should be!), you know that a wealth of knowledge is available. However, they're still pretty techie for most folks.
In Windows Vista, the Resource Monitor made great strides over prior methods (e.g., perf counters and Task Manager). But the Windows 7 Resource Monitor... all I can say is "Wow!" Left to my own devices, I'd play with it for hours, trying little experiments and watching how they show up...
At the topmost level, Resource Monitor has 4 tabs:
- Overview (summary of CPU, Memory, Disk, and Network)
- CPU
- Memory
- Disk
- Network
The overview tab gives the "rolled" up view, similar to the Vista Resource Manager. The remaining tabs drill into more details in their corresponding area. For instance, in the CPU tab, you can see a CPU usage breakdown by service. Likewise, on the Disk tab, you can see a breakdown of disk activity by process. Plus, it's trivial using checkboxes to filter the views to specific processes.
Resource Manager can be found under All Programs | Accessories | System Tools | Resource Monitor, as well as various other shortcuts.
Highly recommended. Check it out!