From 5b75d170d4bb0ee1a879c3238c9085175738c140 Mon Sep 17 00:00:00 2001 From: ManlyMarco Date: Sun, 29 Mar 2020 23:11:52 +0200 Subject: [PATCH] Fix field order --- FPSCounter/MemoryInfo.cs | 67 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/FPSCounter/MemoryInfo.cs b/FPSCounter/MemoryInfo.cs index bef7b59..eeabb85 100644 --- a/FPSCounter/MemoryInfo.cs +++ b/FPSCounter/MemoryInfo.cs @@ -36,8 +36,7 @@ public static PROCESS_MEMORY_COUNTERS QueryProcessMemStatus() private static extern IntPtr GetCurrentProcess(); [DllImport("psapi.dll", SetLastError = true)] - private static extern bool GetProcessMemoryInfo(IntPtr hProcess, [In] [Out] PROCESS_MEMORY_COUNTERS counters, - uint size); + private static extern bool GetProcessMemoryInfo(IntPtr hProcess, [In] [Out] PROCESS_MEMORY_COUNTERS counters, uint size); /// /// contains information about the current state of both physical and virtual memory, including extended memory @@ -57,27 +56,15 @@ public class MEMORYSTATUSEX public uint dwMemoryLoad; /// - /// Size of unreserved and uncommitted memory in the extended portion of the virtual address space of the calling - /// process, in bytes. - /// - public ulong ullAvailExtendedVirtual; - - /// - /// Size of available memory to commit, in bytes. The limit is ullTotalPageFile. + /// Total size of physical memory, in bytes. /// - public ulong ullAvailPageFile; + public ulong ullTotalPhys; /// /// Size of physical memory available, in bytes. /// public ulong ullAvailPhys; - /// - /// Size of unreserved and uncommitted memory in the user mode portion of the virtual address space of the calling - /// process, in bytes. - /// - public ulong ullAvailVirtual; - /// /// Size of the committed memory limit, in bytes. This is physical memory plus the size of the page file, minus a small /// overhead. @@ -85,15 +72,27 @@ public class MEMORYSTATUSEX public ulong ullTotalPageFile; /// - /// Total size of physical memory, in bytes. + /// Size of available memory to commit, in bytes. The limit is ullTotalPageFile. /// - public ulong ullTotalPhys; + public ulong ullAvailPageFile; /// /// Total size of the user mode portion of the virtual address space of the calling process, in bytes. /// public ulong ullTotalVirtual; + /// + /// Size of unreserved and uncommitted memory in the user mode portion of the virtual address space of the calling + /// process, in bytes. + /// + public ulong ullAvailVirtual; + + /// + /// Size of unreserved and uncommitted memory in the extended portion of the virtual address space of the calling + /// process, in bytes. + /// + public ulong ullAvailExtendedVirtual; + /// /// Initializes a new instance of the class. /// @@ -117,25 +116,19 @@ public class PROCESS_MEMORY_COUNTERS public uint PageFaultCount; /// - /// The Commit Charge value in bytes for this process (SIZE_T). Commit Charge is the total amount of memory that the - /// memory manager has committed for a running process. - /// - public ulong PagefileUsage; - - /// - /// The peak value in bytes of the Commit Charge during the lifetime of this process (SIZE_T). + /// The peak working set size, in bytes (SIZE_T). /// - public ulong PeakPagefileUsage; + public ulong PeakWorkingSetSize; /// - /// The peak working set size, in bytes (SIZE_T). + /// The current working set size, in bytes (SIZE_T). /// - public ulong PeakWorkingSetSize; + public ulong WorkingSetSize; /// - /// The current nonpaged pool usage, in bytes (SIZE_T). + /// The peak paged pool usage, in bytes (SIZE_T). /// - public ulong QuotaNonPagedPoolUsage; + public ulong QuotaPeakPagedPoolUsage; /// /// The current paged pool usage, in bytes (SIZE_T). @@ -148,14 +141,20 @@ public class PROCESS_MEMORY_COUNTERS public ulong QuotaPeakNonPagedPoolUsage; /// - /// The peak paged pool usage, in bytes (SIZE_T). + /// The current nonpaged pool usage, in bytes (SIZE_T). /// - public ulong QuotaPeakPagedPoolUsage; + public ulong QuotaNonPagedPoolUsage; /// - /// The current working set size, in bytes (SIZE_T). + /// The Commit Charge value in bytes for this process (SIZE_T). Commit Charge is the total amount of memory that the + /// memory manager has committed for a running process. /// - public ulong WorkingSetSize; + public ulong PagefileUsage; + + /// + /// The peak value in bytes of the Commit Charge during the lifetime of this process (SIZE_T). + /// + public ulong PeakPagefileUsage; public PROCESS_MEMORY_COUNTERS() {