需要一个工具来检测C code内存泄漏 [英] Need a tool to detect memory leaks in C code
问题描述
是否有一个良好的应用程序(即具有某种图形用户界面)在C code检测内存泄漏。我真的想测试我的任务/项目,但被很新的这一点,我使用的终端做的事情纠缠,尤其是用gdb进行调试(对我来说,感觉就像从过去,在那里我可以使用一些爆炸可视化调试器)。
Is there a good application (that has some kind of gui) for testing memory leaks in c code. I would really like to test my assignment/programme but being very new to this, i struggle with using the terminal to do things, especially using gdb for debugging (to me it feels like a blast from the past, where i could be using some visual debugger).
感谢您的帮助。
编辑:平台并不重要 - 我运行的一切;)
edit: platform doesn't matter - i am running everything ;)
推荐答案
根据不同的平台(你不提它) Valgrind的是梦幻般的在Linux系统上。它没有图形用户界面,但并不需要一个。
Depending on the platform (you don't mention it) Valgrind is fantastic on Linux systems. It has no GUI, but doesn't need one.
只要运行的valgrind<路径您的应用程序+参数方式>
,它将运行你的应用程序,并且在存储操作吐出的任何错误
Just run valgrind <path to your application + arguments>
and it will run your application and spit out any errors during memory operations.
添加 - 泄漏检查=全
和 - 显示-可达= YES
选项之后的valgrind
来获得堆栈痕迹在您的内存泄漏产生。
Add the --leak-check=full
and --show-reachable=yes
options after valgrind
to get stack-traces of where your memory leaks originate.
这篇关于需要一个工具来检测C code内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!