ComputerInfo.TotalPhysicalMemory Property

 

Gets the total amount of physical memory for the computer.

This API is not CLS-compliant.

Namespace:   Microsoft.VisualBasic.Devices
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

[CLSCompliantAttribute(false)]
public ulong TotalPhysicalMemory { get; }

Property Value

Type: System.UInt64

A ULong containing the number of bytes of physical memory for the computer.

Exception Condition
Win32Exception

The application cannot obtain the memory status.

The My.Computer.Info.TotalPhysicalMemory property requires Windows XP, Windows 2000 Professional, Windows Server 2003, Windows 2000 Server, or Windows Vista..

This example uses the My.Computer.Info.TotalPhysicalMemory property to display the total amount of physical memory for the computer on which the code runs.

MsgBox("Computer's available physical memory: " & 
    My.Computer.Info.TotalPhysicalMemory)

.NET Framework
Available since 2.0
Return to top
Show: