从 Win32_ComputerSystem 检索到的总物理内存与 DirectX 工具值不匹配

Total Physical Memory retrieved from Win32_ComputerSystem doesn't match with DirectX tool value

我正在尝试通过 Win32_OperatingSystem class 在 C# 中检索我的机器的总物理内存可用值。下面是我如何检索这个值。

 ManagementClass mc = new ManagementClass("Win32_ComputerSystem");
        ManagementObjectCollection moc = mc.GetInstances();
        if (moc.Count != 0)
        {
            foreach (ManagementObject MO in mc.GetInstances())
            {
                try
                {
                    computerSystemDetails["TotalPhysicalMemory"] = (MO["TotalPhysicalMemory"] == null) ? new string[] { } : new string[] { MO["TotalPhysicalMemory"].ToString() };
                }
                catch (Exception ex)
                {
                    logger.Error("GetSystemDetails", "Error occurred when retrieving the computer system information", ex);
                }
            }
        }
        return computerSystemDetails;

我从上面得到的值是 16243 MB。但是当我使用 DirectX 诊断工具时,我得到的值是 16384MB。这种差异的解释是什么?请指教

那个 属性 的 documentation 解释了原因:

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.