Monday, March 03, 2008

Here's a tool form Microsoft I never knew about but find very useful now Debug Diagnostic Tool. Version one was part of IIS Diagnostic toolkit but version 1.1 is a standalone tool

Generating Memory Dumps
When using DebugDiag, you need to first identify what kind of issue you are troubleshooting (e.g. a crash, hang, slow performance, or memory and handle usage). This step will aid in configuring the tool appropriately to get the right data, and therefore identifying the root cause of the problem and resolving it.
Process Crashes
A process crash is usually indicative of an unhandled exception occurring in a process or code running in a process that actively terminates the process. To debug a process crash, start by creating a crash rule against the process(s) in question. Similar to previous debuggers, DebugDiag will attach to a specific process (s) and will monitor the process for multiple types of exceptions or any custom breakpoints that cause the process(s) to terminate unexpectedly. When the crash occurs, a full memory dump file will be created, in the directory specified when setting up the crash rule.
Process Hangs or Slow Performance
To debug a process hang, use one of the following:
1- Create a hang rule. (this feature is available only for IIS processes) . The hang monitoring feature for IIS processes is designed to troubleshoot performance issues when users browse to pages in a web application and the pages take a long time to respond, or do not respond at all. During the hang rule creation wizard, specify the target processes to dump and a URL to be monitored along with a “Ping” interval and a response “timeout” The tools will send a request to the server at the configured intervals, and if the server does not respond before the configured timeout, a memory dump will be generated for the processes specified process(es).
2- Create a manual memory dump during the slow or hang state by right-clicking the process name in the processes view and choosing the “Create Full Userdump” option.
Memory or Handle Usage
To debug memory and handle usage, use one of the following:
1. Create a leak rule against the process in question. The leak monitoring feature will track memory allocations inside the process. Tracking is implemented by injecting a DLL (leaktrack.dll) into the specified process and monitoring memory allocations over time. When configuring a memory and handle leak rule, you can specify memory dump generation based on time or memory usage.
2. Using the “processes” view, right-click the process in question and select the “monitor for leaks” option. When the process has grown to the suspected problem size, manually dump the process by right-clicking on the same process in the processes view and choosing the “Create Full Userdump” option.
Analyzing Memory Dumps:
One of the most powerful features of the DebugDiag is the ability to analyze memory dumps and generate a report file showing the analysis, along with recommendations to resolve identified problems.
DebugDiag uses “Analysis Scripts” to analyze the process dump. 2 main analysis scripts are shipped with the tool:
Crash/Hang Analyzers
The crash/hang analysis script analyzes exception information in the dump for crashes if detected and analyzes known hang causes such as critical section related activity. This script includes IIS, MDAC, COM+ and Windows Socket information relevant to the process.
Memory Pressure Analyzers
The memory pressure analysis script analyzes the memory usage of the process and presents data gathered from the leak monitoring tool, when injected.

posted by Aaron Fischer on Monday, March 03, 2008 8:03:35 AM (Pacific Standard Time, UTC-08:00)   #    Comments [0]