如何在C#中使用Performnace Counter获取进程的%内存使用率 [英] How to get % Memory usage of a process using Performnace Counter in C#

查看:115
本文介绍了如何在C#中使用Performnace Counter获取进程的%内存使用率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得进程使用的内存百分比。

现在,我只能使用以下内容获取可用内存:

PerformanceCounter memProcess = new PerformanceCounter(Memory,Available KBytes);



有没有办法得到想要的结果,可能正在使用一些计算?请帮忙。

I want to get the % of memory used by a process.
Right now, I''m able to get only the available memory by using:
PerformanceCounter memProcess = new PerformanceCounter("Memory", "Available KBytes");

Is there a way to get the desired result, may be using some calculation? Please help.

推荐答案

您可以通过WMI使用它 - http ://www.blackwasp.co.uk/GetMemory.aspx [ ^ ]。
You can use this via WMI - http://www.blackwasp.co.uk/GetMemory.aspx[^].


C#在%中获取已用内存[ ^ ]

系统绩效指标C# [ ^ ]

在C#WPF中监控流程统计 [ ^ ]
C# Get used memory in %[^]
System Performance Indicator in C#[^]
Monitoring Process Statistics in C# WPF[^]


这篇关于如何在C#中使用Performnace Counter获取进程的%内存使用率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆