I'm doing a memory leak investigation using PerfView and I'm following this and this videos.
However, the server I'm investigating has already taken ~100% of memory, so when I try dump GC heap I get an OutOfMemoryException
and the dump file isn't created at all. PerfView log file has the following:
HeapDump Error: System.OutOfMemoryException: Exception of type System.OutOfMemoryException' was thrown.
at System.Collections.Generic.Dictionary`2.Initialize(Int32 capacity)
at System.Collections.Generic.Dictionary`2..ctor(Int32 capacity, IEqualityComparer`1 comparer)
at Graphs.MemoryGraph..ctor(Int32 expectedSize)
at GCHeapDumper.DumpDotNetHeapData(ClrHeap heap, ICorDebugProcess& debugProcess, Boolean isDump)
at GCHeapDumper.TryGetDotNetDump(Int32 processID)
at GCHeapDumper.CaptureLiveHeapDump(Int32 processID)
at GCHeapDumper.DumpLiveHeap(Int32 processID)
at Program.MainWorker(String[] args)
Is it possible to collect memory dump when all memory has been taken already?