我正在使用 PerfView 进行内存泄漏调查,并且我正在关注this和this个视频。
但是,我调查的服务器已经占用了大约100%的内存,所以当我尝试转储GC堆时,我得到一个OutOfMemoryException
并且根本没有创建转储文件。 PerfView 日志文件包含以下内容:
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)
是否可以在已经占用所有内存时收集内存转储?