Determining the amount of memory installed from the ESXi command line (2005821)

Purpose

This article provides a command to determine the amount of memory installed on an ESXi host.

Resolution

To determine the amount of memory installed on an ESXi host, run this command on the host ESXi host through an SSH session:

cim-diagnostic.sh > mem.out 
 
Where mem.out is the file in which the command output is stored.

After you have determined the amount of memory installed on the host, run this command to determine how much memory each slot of physical RAM is reporting.

less -i mem.out
To jump to the memory specific output, run this command from within the less session:

/CIM_Mem
The output appears similar to:

Dumping instances of CIM_Memory
Dumping instances of CIM_PhysicalMemory

OMC_PhysicalMemory.CreationClassName="OMC_PhysicalMemory",Tag="32.0"
Tag = 32.0
CreationClassName = OMC_PhysicalMemory
MaxMemorySpeed = (NULL)
IsSpeedInMhz = false
InterleavePosition = 255
PositionInRow = 255
TotalWidth = 32
Speed = (NULL)
SerialNumber = (NULL)
RemovalConditions = (NULL)
PartNumber = (NULL)
OperationalStatus = { 0, }
MemoryType = 2
Manufacturer = (NULL)
HealthState = (NULL)
FormFactor = 8
ElementName = RAM slot #0
Description = RAM slot #0
DataWidth = 32
Caption = RAM slot #0
Capacity = 2147483648

Note: The capacity of the RAM is in bytes.

Alternate:

#cim-diagnostic.sh | grep -i capacity  will return capacity.