title: C - Valgrind on Mac displaying different result to linux?
body: <p>Here is a very simple program I wrote to show the differences between the valgrind outputs on Mac (El Capitan) and Linux Mint 17.2.</p>
  <p>Is there a way get the same type of output on the mac? I dont understand why it shows more heap usage on the mac than it does on Linux?</p>
  <p>For a strange reason <strong>Linux Mint shows the memory being freed</strong>, whereas <strong>OSX doesn't</strong></p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(int argc, char const *argv[]) {
  
    char *str = (char *)malloc(15);
    strcpy(str, &quot;Hello World!&quot;);
    printf(&quot;%s\n&quot;, str);
    free(str);
    return 0;
  }
  </code></pre>
  <p><strong>Linux Mint 17.2</strong>
  <a href="https://i.stack.imgur.com/aqD93.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aqD93.png" alt="Linux Mint" /></a></p>
  <p><strong>Mac OSX El Capitan</strong>
  <a href="https://i.stack.imgur.com/9IG00.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9IG00.png" alt="MacOSX" /></a></p>