Valgrind quick start guide (sections 1,2,3,4,5 and 6).
Folder with name Valgrind_first
and file testing_valgrind.c
in the shared folder
Subversion. There is a local copy
here
We are going to use the tool Valgrind to detect memory leaks. Valgrind is in fact a framework with a set of tools such as Memcheck (the one we are going to focus on), which allows you to execute a C program and see if any line of your code produces a memory leak or any other memory-related error.
Read the quick start guide offered as resource.
Open a command terminal and compile and execute the
program testing_valgrind.c
that you will find in
the Valgrind_first
folder in your shared
space. Execute again the program using Valgrind and analyze the report
bout the memory usage that is printed.
Modify the program
testing_valgrind.c
such that when executing with
Valgring, no error is shown. Upload the new version of the file to the
repository with Subversion.