title: What tool can I use to analyze memory usage?
body: <p>I have a Windows application written using C++ using Visual Studio 2008. I want to obtain statistics on memory usage to find bottlenecks and locations to work on memory usage. Ideally I'd like to have a tool that does this without having to go in and add counter/profiling logic to the code itself. Basically what I'm looking for is:</p>
  
  <ul>
  <li>List of all allocations (freed or not shouldn't matter, I want to know every time something is allocated)</li>
  <li>Callstack of each allocation and a counter representing the number of times that code was called and memory was allocated.</li>
  <li>Information on what memory has been freed vs not freed (to find leaks). Ideally it would be intelligent enough to determine if memory is still in use or if it really has leaked (via scope, or some other intelligent mechanism).</li>
  </ul>
  
  <p>I don't care if it's a free tool or not. Here are some tools I've already looked at:</p>
  
  <ul>
  <li><strong>Rational PurifyPlus</strong>: Honestly I haven't been able to make much use of this tool. It returns a lot of false positives. Also, it doesn't give me the first 2 items in my list above, it instead seems to only focus on memory errors and leaks.</li>
  <li><strong>Sysinternals VMMap</strong>: This tool is interesting and allows me to see how memory is spread out (stack vs heap vs shared heap, etc). It also lets me see a call tree of allocations but isn't very intuitive or helpful. It's hard to make sense out of the data.</li>
  <li><strong>DevPartner Boundschecker</strong>: I really think this is the most useless tool so far. I used it years ago before they got bought out by DevPartner and I remember it working a lot better. But it doesn't really give me the statistical data I need, nor does it seem to be able to properly detect memory leaks.</li>
  </ul>
  
  <p>I appreciate in advance any help / advice. My application is a server, and suffers serious memory growth issues over time during stress testing (and eventually crashes due to virtual bytes exceeding the limit for 32-bit applications). Having the right tool will help me isolate where we are allocating memory and also where we might be leaking memory.</p>