public static unsafe long GetMemoryWorkingSet() { if (Environment.OSVersion.Platform == PlatformID.Win32NT) { Trinity.Win32.NativeAPI.PROCESS_MEMORY_COUNTERS counter = new Trinity.Win32.NativeAPI.PROCESS_MEMORY_COUNTERS(); NativeAPI.GetProcessMemoryInfo(NativeAPI.GetCurrentProcess(), out counter, sizeof(Trinity.Win32.NativeAPI.PROCESS_MEMORY_COUNTERS)); return(counter.WorkingSetSize.ToInt64()); } else { throw new NotImplementedException(); } }
public static unsafe long GetMemoryWorkingSet() { Trinity.Win32.NativeAPI.PROCESS_MEMORY_COUNTERS counter = new Trinity.Win32.NativeAPI.PROCESS_MEMORY_COUNTERS(); NativeAPI.GetProcessMemoryInfo(NativeAPI.GetCurrentProcess(), out counter, sizeof(Trinity.Win32.NativeAPI.PROCESS_MEMORY_COUNTERS)); return(counter.WorkingSetSize.ToInt64()); }