installation
yum install glibc-utils
Increase header file reference
#include <mcheck.h>
Called in the main function
setenv("MALLOC_TRACE", "mtrace.out", 1);
mtrace();
Compile
gcc -g test.c -o test
carried out
./test
analysis
mtrace test mtrace.out