You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ghw.MemoryInfo.TotalUsableBytes contains the amount of memory the system can actually use. Usable memory accounts for things like the kernel's resident memory size and some reserved system bits
For Windows, the amount of win32_OperatingSystem.TotalVisibleMemorySize field is equal to the total amount of memory that the system has available to it to use, which is what ghw.MemoryInfo.TotalUsableBytes represents.
The ghw.MemoryInfo.TotalPhysicalBytes amount, on the other hand, is the total amount of physical memory (in DIMMs) attached to the hardware. In Linux, this can be determined by looking at syslog startup messages. In Windows, I will need to determine this value by summing the amount of the Win32_MemoryBank WMI table records. I have this on my roadmap to tackle. Hope to get to it in the next month. You can see here for more discussion on this topic:
OS: Windows Server 2019 Datacenter
total memory: 12GB
unused memory: 7.5GB (≈7GB)
but
ghw
print unused=totalreview fix issue#176 WQL
You should use FreePhysicalMemory instead of TotalVisibleMemorySize,
picture from Microsoft WMI API website: https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-operatingsystem
TotalVisibleMemorySize (Units "kilobytes")
FreePhysicalMemory (Units "kilobytes")
The text was updated successfully, but these errors were encountered: