Performance counters: sum of all managed heaps is greather then private bytes RRS feed

  • Question

  • I have the following issue with my process. Why can private bytes value be less than managed heaps? Feel free to consider scenarios with any complexity of inter-process interaction. This reproduces for a child process of an enterprise software application.

    How I do the measurements:

    Private bytes counter is used from Process category

    Heaps are: Gen 0 heap size + Gen 1 heap size + Gen 2 heap size + Large object heap size counters or #Bytes in all heaps + Gen 0 heap size witch gives us the same result.

    I exclude mistakes like wrong instance name for a category. There is no process with the same name in the system.

    Also this is not an update lag, because this issue stroke the application in a stable state and values stay the same for a long period.

    I used perfmon along with manually created counters. It gave me the same result.

    • Edited by Opeykin Friday, February 7, 2014 3:39 PM
    Friday, February 7, 2014 3:36 PM


All replies

  • Hi Opeykin,

    I think it’s impossible. Because private bytes contains managed and unmanaged memory allocation. It cannot smaller than managed heaps. Could you please provide something to prove your speculation like following image?


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, February 10, 2014 5:19 AM
  • Sure. 

    But I can not post an image here yet. Account verification...

    In my opinion the root of the problem comes from the fact, that Gen0 counter is not an obvious one. It shows the amount of memory that will trigger NEXT gc, not previous. So the question: is memory for next gen0 is already allocated?

    For this process most of memory is gen0. Gen0 can be really big, hundreds of megabytes. So considering tricky gen0 counter and huge gen0 heap we encounter this issue.

    • Edited by Opeykin Monday, February 10, 2014 1:16 PM typo
    Monday, February 10, 2014 1:15 PM
  • I think the heaps a in the list of handles.  The process ID is obtained from thje handle number.  A heap as a fixed size of only a few bytes with a pointer to the large allocated memory.


    Monday, February 10, 2014 2:10 PM