title: Memory usage doesn't decrease when free() used
body: <p>I am writing OS independent lockless queue, so far it works great, but there is small problem with memory managment. I am not sure if its gcc problem or mine. Problem: Memory increases when element is added to list, but when element is removed from list (free(elementPointer);) memory usage don't change. </p>
  
  <p>BUT when I use pthreads, N producers and M consumers  <code>(1&lt;N&lt;20, 1&lt;M&lt;20)</code> memory usage is about ~10mb all the time (when trying to add and remove ~10kk elements), so looks like free is working.</p>
  
  <p>And funny thing is that in VS 2010 (same code, no threads) free works fine, memory is released (watched task manager).</p>
  
  <p>I made test, added 1kk elements, after adding all, removed one by one all elements (no threads).</p>
  
  <p>Linux - 0.08 seconds</p>
  
  <p>Windows ~57 seconds</p>
  
  <p>Linux(without free) - 0.07 seconds</p>
  
  <p>Windows(without free) - 0.9 seconds</p>
  
  <p>So, the question is, why memory isn't freed in Linux C when no threads are used ?
  I can post code if necessary .</p>
  
  <p>GCC version: 4.4.3</p>