IServerInformation.PhysicalMemory Property
SQL Server 2012
Gets the total RAM installed, in MB, for the computer that is running the instance of SQL Server.
Namespace: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)