4

I believed both terminologies represent same thing however I see different values and makes me wonder is Total Physical Memory = RAM + something ?

Total Physical Memory output using- "wmic ComputerSystem get TotalPhysicalMemory" 8458973184

RAM information from Windows System Page

enter image description here

I need to monitor RAM and other system related information like CPU so is "wmic" reliable or is there anything else which is good.

1
  • I really can't understand why this question was down voted. We can clearly see the difference in both output.
    – gadhvi
    Jan 1, 2019 at 7:43

2 Answers 2

-2

Microsoft programmers are not very strong on math:

8 GB = 8 589 934 592
7.88 GB = 8 461 085 573
TotalPhysicalMemory = 8 458 973 184
8 GB - TotalPhysicalMemory = 8589934592 - 8458973184 = 130 961 408

What we see here is that the Microsoft programmer that issued the 7.88 GB figure rounded it up, thereby creating about 130 MB of memory that simply does not exist, because this is a fraction of a very large number, the gigabyte. It would have been more correct to round it down, which would be safer for calculations and better mathematics, or even to add more decimal places which would have reduced the rounding error.

You could run the command systeminfo | findstr Memory to get even more numbers.

The TotalPhysicalMemory description says:

Total size of physical memory. Be aware that, under some circumstances, this property may not return an accurate value for the physical memory. For example, it is not accurate if the BIOS is using some of the physical memory. For an accurate value, use the Capacity property in Win32_PhysicalMemory instead.

So you may use wmic, but it's really unclear what you are getting. At least, TotalPhysicalMemory seems to be the smallest number among all those that I found, so it might be safe to use.

13
  • 2
    Saying they are not strong on math is a bit harsh as 7.88 encompasses a wide range of values when you take rounding into account. It could be anything down to 7.876 (rounded to 7.88) which would be lower than the value shown by wmic. An approximate value is good enough for that sort of display and the only way to be 100% accurate would have been to (pointlessly) show the entire value.
    – Mokubai
    Jan 1, 2019 at 11:19
  • @Mokubai: It's a fact that every method in Windows of calculating the memory gives a different result, and it's never clearly defined why. If we are to believe wmic, I get here 7.878 instead, meaning that available memory is rounded up (!) to 7.88, which is really abominable when talking about fractions of gigabytes! Better not to expect mathematical precision here. As I said, TotalPhysicalMemory at least seems minimal, but what it means is unknown.
    – harrymc
    Jan 1, 2019 at 11:38
  • Microsoft programmers use the same "math" as everyone else (e.g. the DIV instruction in the CPU). (rolling eyes here) Jan 1, 2019 at 20:51
  • 1
    otoh, a completely valid criticism (IMO) of many of Windows' system performance numbers is that they use questionable and inconsistent terminology. The figure that would match the amount of RAM physically installed should be called "installed". What is being called "Total physical memory" in wmic's stats should be called "usable" - this excludes stuff like memory-mapped I/O register space that can't be used as ordinary RAM by the OS, but can be accessed by the OS for other purposes (like to control I/O devices). Jan 1, 2019 at 22:43
  • 1
    This post is entirely wrong (and a bit hard on Microsoft). The correct answer as to why there is a discrepancy between the usable and then installed is Jamie's answer. Jan 2, 2019 at 20:18
5

The WMIC counter TotalPhysicalMemory is the subset of the installed RAM that is usable by Windows as ordinary RAM. In other words, this is the number against which you should evaluate numbers like the working set of a process. It is also one contributor to the system commit limit (the other being the current pagefile size).

It excludes what Task Manager calls "hardware reserved". This is mostly RAM that cannot be accessed because its addresses conflict with those of firmware, of "register space" defined by I/O devices, and similar. That is the reason for most of the discrepancy between the 8 GiB you bought and installed vs. WMIC's reported "Total".

Since in your comment you mentioned "free", I should mention that the WMIC counter Win32_OperatingSystem.FreePhysicalMemory corresponds to Task Manager's "Available" display. This is the amount of RAM that is immediately available for use to satisfy hard page faults for new allocations, without taking it from a process that's using it and without having to copy any old contents out to e.g. a pagefile or a mapped file first. It is the sum of what Resource Monitor shows as "Standby" and "Free". (Yes, their terminology is inconsistent - I would say inexcusably so.)

You can get the amount "used" simply by subtracting Win32_operatingsystem.FreePhysicalMemory from Win32_computersystem.TotalPhysicalMemory.

3
  • 1
    Thankyou for detailed explanation.
    – gadhvi
    Jan 3, 2019 at 9:34
  • Thanks for this. Might be worth adding an addendum that the equivalent of Installed RAM is the sum total of all the Capacity properties for the memory slots (Win32_PhysicalMemory). Mar 24 at 17:16
  • Maybe also worth noting that FreePhysicalMemory is kilobytes whereas other values are bytes. Mar 24 at 21:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .