What is private bytes, virtual bytes, working set?

后端 未结 4 1312
暗喜
暗喜 2020-11-22 10:10

I am trying to use the perfmon windows utility to debug memory leaks in a process.

This is how perfmon explains the terms:

Working Set is th

4条回答
  •  醉话见心
    2020-11-22 10:57

    There is an interesting discussion here: http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/307d658a-f677-40f2-bdef-e6352b0bfe9e/ My understanding of this thread is that freeing small allocations are not reflected in Private Bytes or Working Set.

    Long story short:

    if I call

    p=malloc(1000);
    free(p);
    

    then the Private Bytes reflect only the allocation, not the deallocation.

    if I call

    p=malloc(>512k);
    free(p);
    

    then the Private Bytes correctly reflect the allocation and the deallocation.

提交回复
热议问题