简体   繁体   中英

How to get memory consumption of a process as shown inTask Manager (.NET)

I'm still not able to get the memory consumption of a process (usually the current process) exactly as shown in Task Manager. I've already tried several values supplied in System.Diagnostics.Process and some performance counters. Is there some direct way to do that or is it neccesary to add up some values?

Why do want the memory values of task manager? Probably this value is not exactly what you think.

Look at this post for a good overview about memory in .net.

A good overview about memory in general, you find here . Check the also links on the top of the post.

If you have a memory problem, the look here . The video has an interesting part about memory profiling, not only valid for WPF.

To get the total virtual memory use Process.VirtualMemorySize64 . And for more information on the memory usage of the process check MSDN here: How to: Investigate Memory Usage for Processes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM