Difference between revisions of "Valgrind"

From Computer Science
Jump to: navigation, search
 
Line 5: Line 5:
 
valgrind program_file.o
 
valgrind program_file.o
 
</pre>
 
</pre>
 +
To see more detailed information about potential memory leaks, you can use the <code>--leak-check=full</code> option:
 +
<pre>
 +
valgrind --leak-check=full program_file.o
 +
</pre>
 +
 +
More information about valgrind: https://valgrind.org/docs/manual/quick-start.html

Latest revision as of 13:14, 15 November 2022

Note that valgrind is installed on cs.indstate.edu but not on all of the lab desktops, so make sure you are logged into cs in the terminal (e.g., ssh username@cs.indstate.edu).

First, you should make sure to compile your program with debugging information enabled. See GNU Debugger. You can run the valgrind memory checker by running:

valgrind program_file.o

To see more detailed information about potential memory leaks, you can use the --leak-check=full option:

valgrind --leak-check=full program_file.o

More information about valgrind: https://valgrind.org/docs/manual/quick-start.html