是否有可能在 windbg 中获取 GC 性能计数器?

Is it possible to get GC performance counters in windbg?

我有故障转储,我想查看 GC 性能计数器,例如:

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

是否可以从 windbg 或任何其他工具但使用故障转储查看这些计数器? 目前我只知道如何在实时过程中使用性能监视器来做到这一点。

性能计数器数据存储在别处,因此无法从进程转储中读取它们。

"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://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/monitor-view-performance-counter-data-for-data-collector-set

Microsoft 提供 Mex 扩展帮助调试 .Net 程序。您可以使用命令 !clrperf 从转储中获取 CLR 性能计数器。

参考下面的link下载此扩展:

https://www.microsoft.com/en-us/download/details.aspx?id=53304