使用 rpm 安装 mstrace,然后执行以下命令: 设置环境变量 MALLOC_TRACE=mytrace.log 编译测试程序 testmtrace.c 运行程序 ./testmtrace 通过 mtrace testmtrace mytrace.log 分析内存使用情况
C 24 次浏览