0

PrivatePageCount documentation says:

PrivatePageCount

Data type: uint64

Qualifiers: MappingStrings ("Win32API|Process Status|SYSTEM_PROCESS_INFORMATION|PrivatePageCount"), DisplayName ("Private Page Count")

Current number of pages allocated that are only accessible to the process represented by this Win32_Process instance.

But inspecting the ManagementObjectSearcher values, it looks like the same value as PageFileUsage, but in bytes instead of kilobytes.

using (var items = new ManagementObjectSearcher(String.Format("Select * From Win32_Process")).Get())
{
    foreach (var item in items)
    {
        var PageFileUsage = (UInt32)item["PageFileUsage"]; // kb
        var PrivatePageCount = (UInt64)item["PrivatePageCount"]; // same as PageFileUsage?

        Debug.Assert(PageFileUsage == (PrivatePageCount / 1024));
    }
}

Multiplying this value by the system's page size (Environment.SystemPageSize), gives a value in terabytes, but it is not close to Virtual Memory (address space).

Could the documentation be wrong and PrivatePageCount be equivalent to PageFileUsage?

kiewic
  • 15,852
  • 13
  • 78
  • 101
  • _[Somewhat helpful](https://stackoverflow.com/questions/1984186/what-is-private-bytes-virtual-bytes-working-set)_ –  Apr 27 '19 at 07:29
  • 1
    Yes, the documentation is wrong. Unit is bytes, not pages or kbytes. I suspect the author of the article got mislead by the property name, don't we all. – Hans Passant Apr 27 '19 at 12:47

0 Answers0