瓦尔格林德公开简历
Valgrind OpenCV
本文关键字:林德公 更新时间:2023-10-16
这是我的测试程序:
#include "opencv2/videoio.hpp"
int main(int argc, char** argv) {
cv::VideoCapture videoCapture(argv[1]);
cv::Mat frame;
videoCapture.read(frame);
return 0;
}
我像这样运行这个程序:
valgrind --leak-check=yes ./GyroRecord ./walks6/w63/39840012.avi > valgrind_output 2>&1
以便将整个输出保存在valgrind_output
文件中。
valgrind_output
的内容可以在这里查看。
但是,如果链接在将来死亡,则摘要如下:
==9677== LEAK SUMMARY:
==9677== definitely lost: 0 bytes in 0 blocks
==9677== indirectly lost: 0 bytes in 0 blocks
==9677== possibly lost: 1,352 bytes in 18 blocks
==9677== still reachable: 166,408 bytes in 1,296 blocks
==9677== of which reachable via heuristic:
==9677== newarray : 1,536 bytes in 16 blocks
==9677== suppressed: 0 bytes in 0 blocks
==9677== Reachable blocks (those to which a pointer was found) are not shown.
==9677== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==9677==
==9677== For counts of detected and suppressed errors, rerun with: -v
==9677== ERROR SUMMARY: 18 errors from 18 contexts (suppressed: 0 from 0)
我想将"可能丢失"的字节减少到 0。这可能吗?还是在使用OpenCV时,我总是会有一些"可能丢失"的字节?
OpenCV
附带了valgrind
的抑制文件(扩展名为.supp
),可用于隐藏有关已分配资源的消息(通常在程序执行的早期),这些消息将被保留分配,直到程序死亡并且操作系统必须清理混乱。
抑制文件放置在/usr/share/OpenCV
(在我的系统上)中:
例:
valgrind --leak-check=yes --suppressions=/usr/share/OpenCV/valgrind.supp --suppressions=/usr/share/OpenCV/valgrind_3rdparty.supp ./GyroRecord ./walks6/w63/39840012.avi
在OpenCV
项目上运行valgrind
时,使用这些对我有很大帮助。
相关文章:
- 瓦尔格林德:数学函数"Conditional jump or move depends on uninitialised value(s)"
- 为什么瓦尔格林德在不释放恶意内存后没有报告任何问题?
- 瓦尔格林德的内存泄漏使用新的
- CPP 中的瓦尔格林德和记忆泄漏:"Conditional jump or move depends on uninitialised values"
- C++程序什么都不做,但瓦尔格林德显示内存分配
- 赫尔格林德和atomic_flag
- 删除堆后对瓦尔格林德错误感到困惑
- 为什么我会"Invalid read of size 8"?(瓦尔格林德)
- 瓦尔格林德报告在 =带有嵌套shared_ptrs的运算符上的读取错误
- 瓦尔格林德:注意到但未处理的国际奥克特尔;是否有必要处理以及如何找到?
- 瓦尔格林德错误 - 地址0x0不是堆叠的 malloc'd 或自由的
- 瓦尔格林德错误来自 boost::asio
- 瓦尔格林德可能丢失了,仍然可以到达并被瓦尔格林德检测到并被抑制
- 在瓦尔格林德的泄漏摘要中使用 std::ios::sync_with_stdio(fasle) 打印时获取"still reachable"
- 瓦尔格林德"不支持arch_prctl选项"
- 有没有办法只从瓦尔格林德获得泄漏摘要?
- 瓦尔格林德 + --泄漏检查 -> 不泄漏摘要
- 我找不到瓦尔格林德告诉我的记忆链接
- 修复了瓦尔格林德错误内存泄漏的错误
- 3D 阵列中的瓦尔格林德错误C++