How can I get the total physical memory in C#?

前端 未结 5 880
执笔经年
执笔经年 2020-12-15 23:56

I am using the GlobalMemoryStatusEx function to retrieve information about memory, but this function doesn\'t work correctly. It returns 0 for all properties. I

5条回答
  •  悲哀的现实
    2020-12-16 00:29

    you can use this templates:

    long memory = Process.GetCurrentProcess().PeakVirtualMemorySize64;
    

    And another properties with names Peak*64

提交回复
热议问题