public static string ShowMemoryInfo() { MemoryInfo info = new MemoryInfo(); GlobalMemoryStatusEx(info); StringBuilder str = new StringBuilder(); str.Append($"Memory architecture - {info.Length} bit\n"); str.Append($"Memory Load - {info.MemoryLoad}%\n"); str.Append($"Total Memory - {info.TotalPhys / Math.Pow(2, 30)} GB\n"); str.Append($"Available Memory - {info.AvailPhys / Math.Pow(2, 30)} GB\n"); str.Append($"Total Virtual Memory - {info.TotalVirtual / Math.Pow(2, 30)} GB\n"); str.Append($"Available Virtual Memory - {info.AvailVirtual / Math.Pow(2, 30)} GB\n"); return(str.ToString()); }
public static extern bool GlobalMemoryStatusEx(MemoryInfo info);