Is there 开发者_开发百科an API provided by Microsoft to get the private and virtual bytes consumed by a process ?
GetProcessMemoryInfo could be of great use.
To complement the answer by DumbCoder which amongst others gives you physical memory usage, you should also take a look at GlobalMemoryStatusEx.
Here you can find the definition of virtual bytes  according to Microsoft and how you can derive it as a simple difference from two counters that GlobalMemoryStatusEx provides.
Notes of caution:
- The function GlobalMemoryStatusExhas mixed purpose since it provides information about the system as a whole and information specific to the calling process, e.g. virtual memory usage.
- Read/apply the API carefully otherwise you can end up with broken counters.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论