How to get the size of available system memory?

Louis Rhys picture Louis Rhys · Jul 21, 2010 · Viewed 75k times · Source

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

Answer

Hans Passant picture Hans Passant · Jul 21, 2010

Use Microsoft.VisualBasic.Devices.ComputerInfo.TotalPhysicalMemory.

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