一般在VS调试的时候,VS里面显示内存和任务管理器的大小差别很大。
所以可以用下面的代码获取真实的内存占用大小
string prcName = Process.GetCurrentProcess().ProcessName;
var counter_Exec = new PerformanceCounter("Process", "Working Set - Private", prcName);
double dWsp_Exec = (double)counter_Exec.RawValue / 1024.0; <---that is the value in KB
来源:https://stackoverflow.com/a/60740331/7068790
标签:prcName,管理器,Exec,C#,占用,内存 From: https://www.cnblogs.com/hupo376787/p/16857503.html