小编RMR*_*ter的帖子

c ++ - 代码块上的 Valgrind (linux)

我已经用Valgrindin 小程序来检查了memorys leaks它的工作原理。

现在我有一个包含许多类.cpp.h文件的大程序,我正在尝试使用它Valgrind来检查memory leak,因为我用了很多三分球,内存等。

我正在使用linuxand codeblocks 16.01withgcc并尝试Valgrind直接运行,codeblocks但出现以下错误:

 --------------- Application output --------------
valgrind: /myPathToTheProject/ValgrindOut.xml: No such file or directory
Run Code Online (Sandbox Code Playgroud)

如果我用一个只有一个.cpp文件和 main的小项目进行测试,它运行良好,并且Valgrind生成ValgrindOut.xml. 在这个大项目中,我总是收到这个错误。有人知道有什么问题吗?或其他方式或工具来测试memory leak

编辑 - 运行 Valgrind 后的泄漏摘要

Leak summary:

definitely lost: 673 bytes in 6 blocks.
   indirectly lost: 89,128 bytes in 68 blocks.
     possibly lost: 232 bytes in 2 blocks. …
Run Code Online (Sandbox Code Playgroud)

c c++ linux memory-leaks codeblocks

5
推荐指数
1
解决办法
1257
查看次数

标签 统计

c ×1

c++ ×1

codeblocks ×1

linux ×1

memory-leaks ×1