当前位置:网站首页>Detailed explanation of memory leak check tools

Detailed explanation of memory leak check tools

2022-06-26 01:52:00 Look back in vain

memory leak And headaches Let's introduce a tool

mtracke He is tracking memory leak Tools for

Now we need to track code Add include <mcheck.h>  

                                          setenv("MALLOC_TRACE", "taoge.log", "1");

                                          mtrace();

then -g compile   After you run the program, you will see taoge.log    Last use mtrace taoge    To check memory leak The place of , If you haven't located a specific function Just make peace objdump Trace to the specific address And then find out with the program

原网站

版权声明
本文为[Look back in vain]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206260004248286.html