Are there any classes in WMI that can help me extract the Peak Memory Commit开发者_高级运维 Charge for a system? The value can be viewed in Task Manager/"Commit Charge (K)"/"Peak", however, I would like to be able to export this value programatically using .NET.
Going to post Nate C-K's answer as Community Wiki.
There is no performance counter corresponding to the Peak Commit Charge figure. There is a table on TechNet confirming that no counter exists that corresponds to this metric.
So the only way you can log it is to query the number using NtQuerySystemInformation
. A PowerShell sample is available. You could even expose it as a performance counter of your own, which can then be consumed like any other performance counter.
精彩评论