Microsoft KB Archive/919790

= How to use the IIS Debug Diagnostics tool to troubleshoot a memory leak in an IIS process =

Article ID: 919790

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft Internet Information Services 6.0
 * Microsoft Internet Information Services 5.1
 * Microsoft Internet Information Services 5.0

-





INTRODUCTION
A memory leak may occur in Microsoft Internet Information Services (IIS) when an IIS process consumes excessive memory. Inetinfo.exe, Dllhost.exe, and W3wp.exe are examples of IIS processes. IIS caches static content and dynamic content. An IIS process normally uses up to 50 percent of the available physical memory. This memory usage metric pertains to each IIS process, not to a total of all IIS processes. You can use this information and Performance Monitor to identify a memory problem.

Additionally, the following symptoms may occur when an IIS process consumes excessive memory:  In Windows Task Manager, the Mem Usage column indicates that the process consumes excessive memory. In Performance Monitor, the difference increases between the Private Bytes counter and the Virtual Bytes counter of the Process object.  In IIS 6.0, an IIS process uses up to 1.3 gigabytes (GB) of virtual memory. If memory recycling is enabled, an event is logged that resembles the following: Event Type: Information

Event Source: W3SVC

Event Category: None

Event ID: 1077

Date:

Time:

User: N/A

Computer:

Description:

A worker process with process id of '1234' serving application pool 'DefaultAppPool' has requested a recycle because it reached its virtual memory limit.   If memory recycling is not enabled, an IIS process uses up to 1.3 GB of virtual memory and eventually stops responding. Then, an event is logged that resembles the following: Event Type: Warning

Event Source: W3SVC

Event Category: None

Event ID: 1009

Date:

Time:

User: N/A

Computer:

Description:

A process serving application pool 'DefaultAppPool' terminated unexpectedly. The process id was '1234'. The process exit code was '0xc0000005'.

For more information, see Help and Support Center at http://support.microsoft.com.   In IIS 5.0, an IIS process uses up to 1.3 GB of virtual memory and eventually stops responding. Then, an event is logged that resembles the following: Event Type: Error

Event Source: Service Control Manager

Event Category: None

Event ID: 7031

Date:

Time:

User: N/A

Computer:

Description:

The IIS Admin Service service terminated unexpectedly. It has done this 7 time(s). The following corrective action will be taken in 0 milliseconds: No action.

For more information, see Help and Support Center at http://support.microsoft.com. 



MORE INFORMATION
When an IIS process consumes excessive memory, use the IIS Debug Diagnostics tool to troubleshoot the outstanding memory allocations that caused the memory leak. You have to insert the LeakTrack.dll file and then monitor for the memory leak. As soon as the leak is reproduced, a memory dump file is generated. The memory dump file contains the memory leak information.

To use the IIS Debug Diagnostics tool to troubleshoot an IIS process that consumes excessive memory, follow these steps.

Step 1: Download and install the IIS Diagnostics Toolkit
The following files are available for download from the Microsoft Download Center:

IIS Diagnostics Toolkit for 32-bit systems
Download the iisdiag.msi package now.

IIS Diagnostics Toolkit for Itanium-based systems
Download the iisdiag.msi package now.

Step 2: Set up performance logging before the memory leak occurs
 Click Start, point to Programs, point to IIS Diagnostics, point to Debug Diagnostics Tool, and then click Debug Diagnostics Tools 1.0.</li> Click Tools, and then click Options And Settings.</li> Click the Performance Log tab, click Enable Performance Counter Data Logging, and then click OK.</li></ol>

Note The data sampling interval and the time to start monitoring depend on when the memory leak is reproduced. Because of the log size, make sure that you work with support professionals to obtain the information that you need without overwhelming the server.

Step 3: Create a &quot;Memory and Handle Leak&quot; rule
<ol style="list-style-type: lower-alpha;"> Click Start, point to Programs, point to IIS Diagnostics, point to Debug Diagnostics Tool, and then click Debug Diagnostics Tools 1.0.</li> On the Rules tab, click Add Rule.</li> Click Memory and Handle Leak, and then click Next.</li> Select the process that has the memory leak, and then click Next.</li> In the Configure Tracking Duration dialog box, type or select a warm-up time in the Warm-Up time box.

Note If the problem is immediately reproduced, click to select the Start memory tracking immediately when rule is activated check box.</li> In the Tracking Time box, type or select the time that is required to reproduce the problem. Make sure that the Auto-create a crash rule to get userdump on unexpected process exit check box is selected.

Note At the end of the specified time, a dump file is created.</li> Click Next, and then click Finish.</li></ol>

Step 4: Obtain the data manually
<ol style="list-style-type: lower-alpha;"> Click Start, point to Programs, point to IIS Diagnostics, point to Debug Diagnostics Tool, and then click Debug Diagnostics Tools 1.0.</li> Click the Processes tab, right-click the process that you want, and then click Monitor For Leaks.</li> When the leak is reproduced, right-click the process from step 4b, and then click Create Full Userdump.</li></ol>

Note Notice that the status is Active. Additionally, the Userdump Count counter value increases every time that a memory dump file is created.

Step 5: Stop performance logging after the memory dump file is finished
<ol style="list-style-type: lower-alpha;"> Click Start, point to Programs, point to IIS Diagnostics, point to Debug Diagnostics Tool, and then click Debug Diagnostics Tools 1.0.</li> Click Tools, and then click Options And Settings.</li> Click the Performance Log tab, click Disable Performance Counter Data Logging, and then click OK.</li></ol>

Step 6: Analyze the memory dump file
For more information about how to analyze the memory dump file, click the following article number to view the article in the Microsoft Knowledge Base:

921464 How to use the Debug Diagnostics 1.0 tool to analyze a memory dump file

Step 7: If you are using custom .dll files, add the &quot;Symbol Search Path For Analysis&quot; path or the &quot;Symbol Search Path for Debugging&quot; path
<ol style="list-style-type: lower-alpha;"> <li>Click Tools, and then click Options And Settings.</li> <li>In the Symbol Search Path For Analysis box or in the Symbol Search Path for Debugging box, type the appropriate path, and then click OK.</li></ol>

Additional query words: high iis5 iis6 iis iis5.1 debugdiag 5.0 6.0 5.1 responsive not non hanging white hourglass slow responding blank spinning performance unresponsive diagnostics

Keywords: kbhowto kbinfo KB919790

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.