title: What is private bytes, virtual bytes, working set?
body: <p>I am trying to use the perfmon windows utility to debug memory leaks in a process.</p>
  
  <p>This is how perfmon explains the terms:</p>
  
  <p><strong>Working Set</strong> is the current size, in bytes, of the Working Set of this process. The Working Set is the set of memory pages touched recently by the threads in the process. If free memory in the computer is above a threshold, pages are left in the Working Set of a process even if they are not in use.  When free memory falls below a threshold, pages are trimmed from Working Sets. If they are needed they will then be soft-faulted back into the Working Set before leaving main memory.</p>
  
  <p><strong>Virtual Bytes</strong> is the current size, in bytes, of the virtual address space the process is using. Use of virtual address space does not necessarily imply corresponding use of either disk or main memory pages. Virtual space is finite, and the process can limit its ability to load libraries.</p>
  
  <p><strong>Private Bytes</strong> is the current size, in bytes, of memory that this process has allocated that cannot be shared with other processes.</p>
  
  <p>These are the questions I have:</p>
  
  <p><em>Is it the Private Bytes which I should measure to be sure if the process is having any leaks as it does not involve any shared libraries and any leaks, if happening, will come from the process itself?</em></p>
  
  <p><em>What is the total memory consumed by the process? Is it the Virtual Bytes or is it the sum of Virtual Bytes and Working Set?</em></p>
  
  <p><em>Is there any relation between Private Bytes, Working Set and Virtual Bytes?</em></p>
  
  <p><em>Are there any other tools that give a better idea of the memory usage?</em></p>