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 8, 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 8, 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 9, 2018 12:36 PM
  • It depends on the OS installed and its configuration.


    Friday, February 9, 2018 12:39 PM
  • As it turns out, RAM was added to this virtual machine through VMWare VSphere Client.

    The "InstalledRAM" query (and Task Manager) recognized the difference immediately, but the PhysicalRAM query did not.

    Only after a reboot did the two values match within reason.

    I'm still not sure if the difference is cause for concern, but I plan to use this info to suggest a reboot.

    Tuesday, March 27, 2018 11:48 AM