Win32_PhysicalMemory and Win32_ComputerSystem disagree on RAM total


  • Hi. I have a few virtual machines where the following queries produce different results

    $PhysicalRAM = (Get-WMIObject -class Win32_PhysicalMemory -ComputerName $Computer |
    Measure-Object -Property capacity -Sum | % {[Math]::Round(($_.sum / 1GB),2)})

    $InstalledRAM = Get-WmiObject -Class Win32_ComputerSystem
    [Math]::Round(($InstalledRAM.TotalPhysicalMemory/ 1GB),2)

    I was introduced to the concept of "Physical RAM" and "installed RAM" from this TechNet post, which unfortunately I cannot conceptualize for a virtual machine.

    One machine reports a Physical RAM of 12GB and Installed RAM of 96GB. Is this cause for concern?

    Thursday, February 08, 2018 3:26 PM

All replies

  • There will always be a difference depending on OS and architecture.
    PS D:\scripts> Get-WmiObject -Class Win32_ComputerSystem | select TotalPhysicalMemory
    PS D:\scripts> Get-WMIObject -class Win32_PhysicalMemory | Measure-Object -sum capacity | select sum


    Thursday, February 08, 2018 8:52 PM
  • In most cases, yes, the two numbers are comparable by a few KB/MB.

    Your example shows a machine of 16GB, varying by 144MB.

    However, my example shows a difference of 86000 MB  (84 GB).

    Is this an acceptable difference?

    Friday, February 09, 2018 12:36 PM
  • It depends on the OS installed and its configuration.


    Friday, February 09, 2018 12:39 PM