Search code examples
debuggingcrashgarbage-collectionwindbgperformancecounter

Is it possible to get GC performance counters in windbg?


I have a crash dump and I would like to see GC performance counters such as:

% Time in GC, allocated bytes / sec,
# Induced GC,
# Gen 0 Collections,
# Gen 1 Collections,
# Gen 2 Collections,

Is it possible to see these counters from windbg or any other tool but using the crashdump? At the moment I only know how to do that using Performance Monitor in a live process.


Solution

  • Performance counter data are stored elsewhere, so it is impossible to read them from a process dump.

    "When you run a Data Collector Set, the data that is collected for performance counters is stored to a log file (.blg) in the location that was defined when the Data Collector Set was created. In Windows Performance Monitor, you can view log files to see a visual representation of performance counter data."

    https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/monitor-view-performance-counter-data-for-data-collector-set