So we already talked about what to gather when you are experiencing high memory. But what if you are actually getting a System.OutOfMemoryException? Here is how you capture a dump at the time you are running out of memory.
The following steps will configure DebugDiag to automatically capture the memory dump when the System.OutOfMemoryException occurs.
A. Download DebugDiag: ====================
B. Create a Performance Monitor log: ====================================
For the ASP.NET counters, select the version that you are wanting to monitor. Ex. For 1.1 framework, select ASP.NET v1.1.4322 and ASP.NET Applications v1.1.4322.
Note: For more information on Performance monitor, see KB 248345
C. Configure server to capture OutOfMemoryException ===========================================
Add the following registry key. This was added to the .NET Framework so that a breakpoint exception will be thrown when an OutOfMemory condition occurs. This is documented in the following article:
820745 Failfast occurs when you experience an "out of memory" condition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\ DWord: GCFailFastOnOOM Value: 2
D. Configure DebugDiag ===================
Configure DebugDiag to capture the memory dump when the BreakPoint Exception is thrown and when the process stops.
Inject LeakTrack.dll to capture native leak information:
The memory dump will automatically get captured when the OutOfMemoryException is thrown.
A. Stop the Performance Monitor log ===================================
In Performance Monitor: