Describe the procedure for using Valgrind to profile and check memory leaks.
Purpose
Describe the procedure for using Valgrind to profile and check memory leaks.
Valgrind runs on Linux and MacOS platforms.
Procedure:
- Follow the INSTALL.txt to build from source with debugging.
- [admb-trunk]$ make debug
- Build model with debug.
- [admb-trunk/examples/admb/simple/]$ admb -g simple
- Check memory.
- [admb-trunk/examples/admb/simple/]$ valgrind –tool=memcheck –leak-check=full ./simple
- Output gives description of any leaks.
- Check profile.
- [admb-trunk/examples/admb/simple/]$ valgrind –tool=callgrind ./simple
Visualize profile
- [admb-trunk/example/admb/simple/]$ kcachegrind callgrind.*