title: std::cout causes memory leak
body: <p>I have a very simple C++ program.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int main()
  {
      std::cout &lt;&lt; "HI" &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>
  
  <p>I compile this on a Mac with the command <code>c++ --std=c++11 leak.cpp</code>.</p>
  
  <p>When I debug this with <code>valgrind --leak-check=full ./a.out</code>, I get the following output:</p>
  
  <pre><code>==2187== HEAP SUMMARY:
  ==2187==     in use at exit: 38,906 bytes in 429 blocks
  ==2187==   total heap usage: 508 allocs, 79 frees, 45,074 bytes allocated
  ==2187== 
  ==2187== LEAK SUMMARY:
  ==2187==    definitely lost: 0 bytes in 0 blocks
  ==2187==    indirectly lost: 0 bytes in 0 blocks
  ==2187==      possibly lost: 0 bytes in 0 blocks
  ==2187==    still reachable: 4,096 bytes in 1 blocks
  ==2187==         suppressed: 34,810 bytes in 428 blocks
  ==2187== Reachable blocks (those to which a pointer was found) are not shown.
  ==2187== To see them, rerun with: --leak-check=full --show-leak-kinds=all
  </code></pre>
  
  <p>Turns out there are 4096 bytes that are "still reachable". If I remove the <code>cout</code> statement then there are no more "still reachable" bytes.</p>
  
  <p>Why is it the case that outputting to <code>std::cout</code> causes a memory leak?</p>