Debugging Tools for Windows

Process Hangs or Consumes 100 Percent of CPU

You can use ADPlus to diagnose a process that has stopped responding (that is, hung) or is consuming 100 % CPU (for sustained periods of time, or indefinitely). If you want to diagnose this problem after it has begun, you should run ADPlus in hang mode to obtain a memory dump of the process.

If you run ADPlus in hang mode during the 100 % CPU condition, ADPlus creates memory dumps of the process or processes that are specified at the command prompt.

For example, use one of the following command syntaxes.

The following command runs ADPlus in hang mode and produces a full memory dump of a process with PID 1896.

ADPlus -hang -p 1896

The following command runs ADPlus in hang mode and produces full memory dumps of all processes that are named Myapp.exe.

ADPlus -hang -pn myapp.exe

The following command runs ADPlus in hang mode and produces full memory dumps of IIS, all instances of Mtx.exe or Dllhost.exe, and all processes that are named Myapp.exe. The command then puts the memory dumps in the C:\Temp folder.

ADPlus -hang -iis -pn myapp.exe -o c:\temp

Unable to Attach in Hang Mode

In rare situations, the debugger cannot attach to the process after the 100 % CPU condition or hang has occurred. And if you run ADPlus in hang mode after the problem occurs, ADPlus might not produce memory dumps.

In these situations, you should attach the debugger before the problem occurs. To attach the debugger in this manner, run ADPlus in crash mode as follows:

ADPlus -crash -p 1896

This command runs ADPlus in crash mode for a process with PID 1896 and waits for an exception or a user to press CTRL+C in the minimized debugger window to generate a memory dump and detach the debugger.

The following command runs ADPlus in crash mode for the process named Myapp.exe and waits for an exception or a user to press CTRL+C in the minimized debugger window to generate a memory dump and detach the debugger.

ADPlus -crash -pn myapp.exe

The following command runs ADPlus in crash mode for all instances of the process named Myapp.exe, in addition to Inetinfo.exe and all instances of Mtx.exe or Dllhost.exe. The minimized debugger then waits for an exception or a user to press CTRL+C in the minimized debugger window to generate a memory dump and detach the debugger. The memory dumps and log files are then put in the C:\Temp folder.

ADPlus -crash -iis -pn myapp.exe -o c:\temp

Reconfiguring ADPlus

By default, ADPlus produces minidump files only when you press CTRL+C. (This restriction conserves disk space.)

If a process stops responding or consumes 100 % CPU, you might want to configure ADPlus to generate a full memory dump when the user presses CTRL+C. For more information about this configuration, see ADPlus Command-Line Options and ADPlus Configuration Files.

In addition, it might help to capture a performance or system monitor log file for the time up to and including the 100 % CPU condition. At a minimum, this log file should capture the following objects at 1-5 second intervals:

Additional Information

For more information about how to debug a process that is consuming 100% of CPU, see Tracking Down a Processor Hog.

Build machine: CAPEBUILD