I have a full process dump from an NT service (implemented using C# / .NET 4.5.2) that's in the middle of a GC cycle. When I load it into WinDbg and try to run !DumpHeap -stat
(or any other variant of DumpHeap
), I get this warning:
The garbage collector data structures are not in a valid state for traversal. It is either in the "plan phase," where objects are being moved around, or we are at the initialization or shutdown of the gc heap. Commands related to displaying, finding or traversing objects as well as gc heap segments may not work properly. !dumpheap and !verifyheap may incorrectly complain of heap consistency errors.
Unfortunately, I cannot (easily) get a clean memory dump outside of GC (I obviously don't know when it happens and I need a dump of some manageable size - the process I'm looking at leaks memory and reaches 18 GB sometimes; this is so big that most heap lookups take over 40 minutes in WinDbg.)
This warning message shows up even when I use the -short
parameter to only generate object addresses (to input them into a WinDbg macro) - unfortunately the words of the warning message are passed as input parameters to the macro and the macros blows up. (The macro is a variant of this question and I'm trying to run !GCRoot
on a large number of object instances.)
Is there a way to disable this warning message in WinDbg? (DumpHeap
is part of SOS, so I guess it needs to be disabled there, if possible.)
Edit: to make it clear, I get useful output from DumpHeap
and other commands (which seem mostly consistent), it's just that all output begins with the above warning, even when using -short
. This means that I cannot fed the output into other commands.