Debug live website crash with DebugDiag and Windbg – capture memory dump

Application crash

In this scenario we want to capture a memory dump at the exact moment the application has crashed.

Start the “Debug Diag Collection” tool and select “Crash”

debugdiag-crash-wizard

Select a specific application pool, i.e the application pool that your site is running.

debugdiag-crash-application-pool

Select the application pool of your website

debugdiag-crash-select-application-pool

Leave the defaults selected. In DebugDiag 2.0 this will record the call stack for first chance exceptions and a full memory dump for second chance exceptions, i.e. an application crash.

debugdiag-configuration

Take note of the logs files path: C:\Program Files\DebugDiag\Logs

debugdiag-dump-location

Finish the wizard to activate the collection rule.

debugdiag-activate-rule

You will find that DebugDiag generates several files:

  • .txt files that will record the first chance exception call stacks, libraries loaded into the appdomain and thread creation

  • .dmp files that are a dump of the memory contents of the application

It is the .dmp file that will be loaded and analysed in WinDbg.