Private bytes

sajkwrangler 21 Reputation points
2022-09-21T13:39:40.857+00:00

Why do I get a different value for private bytes from perfmon, process explorer and vmmap. They all have a different value. Which one is correct?

Sysinternals
Sysinternals
Advanced system utilities to manage, troubleshoot, and diagnose Windows and Linux systems and applications.
1,239 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Taylor 60,161 Reputation points
    2022-09-21T14:00:01.32+00:00

    They all measure different things. The whole "private vs shared vs public" discussion is complicated. Even the folks at MS give mixed answers. Ultimately they call Win32 APIs to get values so it depends on the API they call. The source of reference for me is the Windows Internal book written by Mark who also wrote several of these tools. He wrote a lengthy series of blogs about this topic quite a few years ago but I cannot find them right now to link to them. So here's some other links.

    At a summary level, private bytes is the non-shared, committed memory of your process. That could include memory that is currently paged to disk. So each tool may be looking at slightly different sets of values to get the information (or it could just be changing a lot). GetProcessMemoryInfo, for example, added private bytes to the returned data but then documents that it is really just the committed memory.
    Ultimately I think the perf counters are the most accurate in terms of what the "private bytes" are. Without having the Windows source code I suspect they ultimately rely on the perf counters to get their value.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.