Debug Diagnostic 1.2 – Creating a Memory Leak rule (unmanaged code)

This article will detail the action plan you can implement to create a rule in Debug Diagnostic 1.2 to automate a dump when you are facing a huge memory consumption generated by some unmanaged code inside a process owned by IIS (in example a "W3WP.exe" process).

Action Plan

!!! Warning !!! A dump in "Memory Leak" mode implies the load of a DLL named "Leaktrack.dll" in the "W3WP.exe" process. This DLL will save every memory allocation/liberation and can impact application performance and in the same way impact server performance.
!!! Warning 2 !!! This rule will be valid for a unique instance of a process. This means if the process is restarted (thus his Process ID has changed), the rule will not be active anymore.

  • Debug Diagnostic 1.2 can be download at the following URL:
  • Once the tool has been installed and executed on the IIS server, the wizard "Select Rule Type" loads
  • Choose "Native (non-.NET) Memory and Handle Leak", and then click on "Next >"


  • Select the "W3WP.exe" process facing the memory consumption issue, then click on "Next >"



  • Configure the "Configure Leak Rule" as followed:



  • If you are facing a private bytes memory consumption issue:
    • Click on "Configure…" and set "Configure userdumps for Leak Rule" parameters as followed:


  • If you are facing a virtual memory consumption issue:
    • Click on "Configure…" and set "Configure userdumps for Leak Rule" parameters as followed:

  • Click on "Save & Close", then click on "Next >"


  • Choose a name and a location for dumps file, then click on "Next >"
    • Setting those dumps on another disk than C:\ is possible
    • Please check you have enough available space disk as the dump size will be equal to the memory consumed by the process you are monitoring

  • In the window "Rule Completed", select "Activate the rule now", and then click on "Finish"
    • The rule is now configured and ready to generate dumps


  • Check the status is "Active"
    • If it's not, The "DbgSvc" service is surely not started
    • You can go in "Administrative Tools > Services" and start it
  • When a dump will be generated, you'll see the column "UserDump Count" being incremented

The dumps are located by default in "C:\Program Files\DebugDiag\Logs\Crash rule for all IIS_COM+ related processes" or in "C:\Program Files\DebugDiag\Logs\Rule_Name".


We hope this article will help you out.

See you soon.

Sylvain Lecerf and the French IIS Microsoft Support Team

Comments (2)
  1. Dilip says:

    When i try to create memory leak rule, I get  error: "Failed to monitor for leaks in process …. Please make sure that everyone has read and execute permissions for …LeakTrack.dll"."

    How do i resolve it?

  2. Ofek Shilon says:

    Hi and thanks for a great tool!  Several questions and comments:

    1) The distinction between 'private bytes' and 'virtual memory' in the above is probably missing some text.

    2) In my experiments so far (DebugDiag 2.1) I see *all* outstanding allocations at the dumps. To make this process useful I'd like to set a particular dump as base line and analyze leaks only as additional allocations beyond those.  Is it possible? Does this happen and I somehow missed it?

Comments are closed.

Skip to main content