Microsoft KB Archive/935268

= Components of the user interface in Windows Vista report slightly different values for the total physical memory that is available on the computer =

Article ID: 935268

Article Last Modified on 4/17/2007

-

APPLIES TO


 * Windows Vista Ultimate
 * Windows Vista Enterprise
 * Windows Vista Business
 * Windows Vista Home Premium
 * Windows Vista Home Basic
 * Windows Vista Ultimate 64-bit Edition
 * Windows Vista Enterprise 64-bit Edition
 * Windows Vista Business 64-bit Edition
 * Windows Vista Home Premium 64-bit Edition
 * Windows Vista Home Basic 64-bit Edition
 * Windows Vista Starter

-



INTRODUCTION
The total physical memory that is on a computer is displayed in several components of the user interface (UI) in Windows Vista. Each component reports a slightly different value. This article discusses why different components report slightly different values. Additionally, this article identifies the component that shows the most accurate value. It also contains information about the application programming interface (API) that retrieves the most accurate value.



MORE INFORMATION
The components of the UI in Windows Vista that report the total physical memory on the computer include the following:
 * The Welcome Center item in Control Panel
 * The System item in Control Panel
 * The Performance tab of Task Manager
 * The &quot;View and print details&quot; page of the Performance Information and Tools item in Control Panel
 * The Microsoft System Information (Msinfo32.exe) tool

Each component reports a slightly different amount of total RAM that is available on the computer. This behavior occurs because some components were designed to display a consumer-friendly amount of RAM. Additionally, each component was developed by different teams at different times for a particular purpose.

For example, you may experience the following scenario when you view the following components on a Windows Vista-based computer:
 * The Welcome Center item in Control Panel reports 2.00 GB of RAM
 * The System item in Control Panel reports 2046 MB of RAM
 * The Performance tab of Task Manager reports 2045 MB of RAM
 * The &quot;View and print details&quot; page of the Performance Information and Tools item in Control Panel reports 2.00 GB of RAM
 * The System Information tool reports 2,045.54 MB of RAM

Of these components, the System Information tool reports the most accurate value for total physical memory.

How to use the API to obtain the total physical memory value
To retrieve the most accurate value that is under program control, developers should follow these steps:
 * 1) Call the GlobalMemoryStatusEx function.
 * 2) Query the ullAvailPhys member of the MEMORYSTATUSEX structure.

The components use either the GlobalMemoryStatusEx function or the same kernel technique that is used by the GlobalMemoryStatusEx function to calculate the total physical memory on a computer. To programmatically obtain this value, query the ullAvailPhys member of the MEMORYSTATUSEX structure passed as input to the GlobalMemoryStatusEx function.

The GlobalMemoryStatusEx function was not available at the time that some components were built. However, all components calculate the physical memory on the computer in the same manner. The only difference among the components is the rounding that occurs before the total physical memory is displayed in the UI.

