title: native memory leak - how to find callstack of allocation source
body: <p>Based on following output of !address -summary command, I think I have got a native memory leak. In order to deterine the callstack on where these allocations are happening, I am following article at <a href="http://www.codeproject.com/KB/cpp/MemoryLeak.aspx" rel="nofollow">http://www.codeproject.com/KB/cpp/MemoryLeak.aspx</a> </p>
  
  <pre><code>0:000&gt; !address -summary  
   TEB 7efdd000 in range 7efdb000 7efde000  
   TEB 7efda000 in range 7efd8000 7efdb000  
   TEB 7efd7000 in range 7efd5000 7efd8000  
   TEB 7efaf000 in range 7efad000 7efb0000  
   TEB 7efac000 in range 7efaa000 7efad000  
   ProcessParametrs 00441b78 in range 00440000 00540000  
   Environment 004407f0 in range 00440000 00540000  
  
  -------------------- Usage SUMMARY --------------------------  
      TotSize (      KB)   Pct(Tots) Pct(Busy)   Usage  
      551a000 (   87144) : 04.16%    14.59%    : RegionUsageIsVAD  
     5b8d3000 ( 1499980) : 71.53%    00.00%    : RegionUsageFree  
      2cc3000 (   45836) : 02.19%    07.68%    : RegionUsageImage  
       4ff000 (    5116) : 00.24%    00.86%    : RegionUsageStack  
            0 (       0) : 00.00%    00.00%    : RegionUsageTeb  
     1c040000 (  459008) : 21.89%    76.87%    : RegionUsageHeap  
            0 (       0) : 00.00%    00.00%    : RegionUsagePageHeap  
         1000 (       4) : 00.00%    00.00%    : RegionUsagePeb  
            0 (       0) : 00.00%    00.00%    : RegionUsageProcessParametrs  
            0 (       0) : 00.00%    00.00%    : RegionUsageEnvironmentBlock  
         Tot: 7fff0000 (2097088 KB) Busy: 2471d000 (597108 KB)  
  
  
  0:000&gt; !heap -s  
  LFH Key                   : 0x7fdcf95f  
  Termination on corruption : DISABLED  
    Heap     Flags   Reserv  Commit  Virt   Free  List   UCR  Virt  Lock  Fast   
                      (k)     (k)    (k)     (k) length      blocks cont. heap   
  -----------------------------------------------------------------------------  
  00440000 00000002  453568 436656 453568     62    54    32    0      0   LFH    
  006b0000 00001002      64     16     64      4     2     1    0      0        
  002b0000 00041002     256      4    256      2     1     1    0      0        
  00620000 00001002      64     16     64      5     2     1    0      0        
  00250000 00001002      64     16     64      4     2     1    0      0        
  007d0000 00041002     256      4    256      0     1     1    0      0        
  005c0000 00001002    1088    388   1088      7    17     2    0      0   LFH  
  02070000 00041002     256      4    256      1     1     1    0      0        
  02270000 00041002     256    144    256      0     1     1    0      0   LFH  
  04e10000 00001002    3136   1764   3136    384    36     3    0      0   LFH  
      External fragmentation  21 % (36 free blocks)  
  -----------------------------------------------------------------------------  
  </code></pre>
  
  <p>But when I run !heap -p –a command, I don’t get any callstack, just the following. Any ideas how to get callstack of allocations source?</p>
  
  <pre><code>0:000&gt; !heap -p -a 0218e008  
      address 0218e008 found in  
      _HEAP @ 4e10000  
        HEAP_ENTRY Size Prev Flags    UserPtr UserSize - state  
          0218e000 001c 0000  [00]   0218e008    000d4 - (busy)  
  </code></pre>