title: Valgrind and Memory Leaks
body: <p>I'm doing a little bit of memory profiling to my software and after running standard memory leak check with valgrind's following command</p>
  <pre><code>valgrind --tool=memcheck --leak-check=full ./path_to_program
  </code></pre>
  <p>I got following summary:</p>
  <blockquote>
  <p>==12550== LEAK SUMMARY:</p>
  <p>==12550==    definitely lost: 597,170 bytes in 7 blocks</p>
  <p>==12550==    indirectly lost: 120 bytes in 10 blocks</p>
  <p>==12550==      possibly lost: 770,281 bytes in 1,455 blocks</p>
  <p>==12550==    still reachable: 181,189 bytes in 2,319 blocks</p>
  <p>==12550==         suppressed: 0 bytes in 0 blocks</p>
  <p>==12550== Reachable blocks (those to which a pointer was found) are not shown.</p>
  <p>==12550== To see them, rerun with: --leak-check=full --show-reachable=yes</p>
  <p>==12550==</p>
  <p>==12550== For counts of detected and suppressed errors, rerun with: -v</p>
  <p>==12550== ERROR SUMMARY: 325 errors from 325 contexts (suppressed: 176 from 11)</p>
  </blockquote>
  <p>It doesn't look quite good to me, so my question is</p>
  <blockquote>
  <p>Why isn't my program exploding if it has all these leaks?</p>
  </blockquote>
  <p>And also what is the difference between:</p>
  <ul>
  <li>definitely lost</li>
  <li>indirectly lost</li>
  <li>possibly lost</li>
  <li>still reachable</li>
  </ul>
  <p>and how can I try to fix them?</p>