title: C++ delete does not free all memory (Windows)
body: <p>I need help understanding problems with my memory allocation and deallocation on Windows. I'm using VS11 compiler (VS2012 IDE) with latest update at the moment (Update 3 RC).</p>
  
  <p>Problem is: I'm allocating dynamically some memory for a 2-dimensional array and immediately deallocating it. Still, before memory allocation, my process memory usage is <strong>0,3 MB before allocation, on allocation 259,6 MB (expected since 32768 arrays of 64 bit ints (8bytes) are allocated), 4106,8 MB during allocation, but after deallocation memory does not drop to expected 0,3 MB, but is stuck at 12,7 MB</strong>. Since I'm deallocating all heap memory I've taken, I've expected memory to be back to 0,3 MB.</p>
  
  <p>This is the code in C++ I'm using:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #define SIZE 32768
  int main( int argc, char* argv[] ) {
  std::getchar();
  
  int ** p_p_dynamic2d = new int*[SIZE];
  
  for(int i=0; i&lt;SIZE; i++){
      p_p_dynamic2d[i] = new int[SIZE];
  }   
  std::getchar();
  
  for(int i=0; i&lt;SIZE; i++){
      for(int j=0; j&lt;SIZE; j++){
          p_p_dynamic2d[i][j] = j+i;
      }
  }
  
  std::getchar();
  
  for(int i=0; i&lt;SIZE; i++) {
      delete [] p_p_dynamic2d[i];
  }
  delete [] p_p_dynamic2d;
  
  std::getchar();
  return 0;
  }
  </code></pre>