Using Valgrind to detect Memory Leaks (still reachable)

ABOUT Memory Leak In computer science, a memory leak is a type of resource leak that occurs when a computer program incorrectly manages memory allocations[1] in such a way that memory which is no longer needed is not released. A memory leak may also happen when an object is stored in memory but cannot be …

Detecting Memory leaks

commandline session $valgrind –tool=memcheck –leak-check=full ./a.out ==6002== Memcheck, a memory error detector ==6002== Copyright (C) 2002-2012, and GNU GPL’d, by Julian Seward et al. ==6002== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==6002== Command: ./a.out ==6002== -31 0 1 2 2 4 100 83 99 782 ==6002== ==6002== HEAP SUMMARY: ==6002== in …