mtrace内存泄露检查工具

安装

yum install glibc-utils

增加头文件引用

#include <mcheck.h>

主函数中调用

setenv("MALLOC_TRACE", "mtrace.out", 1);
mtrace();

编译

gcc -g test.c -o test

执行

./test

分析

mtrace test mtrace.out

猜你喜欢

转载自blog.csdn.net/woailp___2005/article/details/106361101