title: C++ delete doesn't allways work as expected in windows
body: <p>I'm very frustrated over something very simple (or so I guess), so help in this matter would be very much appreciated. (Sorry if this has already been answered, I haven't had the luck of finding it somewhere else, that's why I'm asking...)
  So, I've written the following very simple program, for test purposes.</p>
  
  <pre><code>class myclass{
      int x[99999];
  public:
      myclass(){}
  };
  
  int main(){
      myclass *x = new myclass;
      delete x;
  }
  </code></pre>
  
  <p>Having used a break point in the 1st line of main, it's easy for me (using visual
  studio 2010 and windows resource monitor) to realize, that after delete is called, the
  reserved memory for this program is not released after delete x.
  If I change x[99999] in myclass, to x[999999] (adding an extra 9), then the allocated memory is indeed freed. I'm worried about this peculiar behavior (which happens in various similar tests), but
  as it is expected, this program is not really what's worrying me...
  My first problem is that, I'm not sure if I can trust windows resource monitor or not.
  Is it really updating its output all the time? Or just when certain amounts of space are (de)allocated? If it's the second, would you please recommend to me a tool that monitors resources precisely?
  Secondly, I have used a program (I don't remember what it was called) that checks an executable for memory leaks, for a larger project of mine. No memory leaks were found. However, a certain event would cause very small amounts of memory leak (according to windows resource monitor). Every 4 calls to a certain event would cause about 1 KB of memory leak.
  I'm quite certain that, that part of my code is correct, but similarly to the example above
  it reserves small amounts of memory, which windows perhaps doesn't "consider" worthy enough to deallocate when asked to, perhaps?
  Or perhaps each function call on windows collects some system garbage? (I doubt that...)
  Or perhaps heap calls accumulate garbage? (I doubt that too...)
  Does the code above free the memory it reserves as expected to your machine?
  Do you have anything to propose to me about my peculiar situation?
  Please don't start telling about the stack, heap, and how they work.
  I'm well aware of all of that, theoretically. It just doesn't work exactly like that in practice. Thank you in advance, and sorry if my English is not perfect (not my native tongue).</p>