Search code examples
c#.netmemorydiagnostics

How to get the size of available system memory?


Is it possible to get the size of system available memory in C#.NET? if yes how?


Solution

  • Use Microsoft.VisualBasic.Devices.ComputerInfo.TotalPhysicalMemory.

    Right-click your project, Add Reference, select Microsoft.VisualBasic.