用于Qt内存的抑制文件与Valgrind泄漏 [英] Suppression files for Qt memory leaks with Valgrind

查看:239
本文介绍了用于Qt内存的抑制文件与Valgrind泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通常在C ++中写我的类,并检查他们是否在Linux平台上使用valgrind泄露内存。我不满足,直到所有的堆内存释放。

I usually write my classes in C++ and check if they leak memory using valgrind on Linux platform. I'm not satisfied until all the heap memory is freed.

开始写在Qt,我发现valgrind检测到多少泄漏,也在一个简单的项目。

Starting to write in Qt, I found how many leaks valgrind detects, also on a simple project. They are so many that it's difficult to detect my same leaks.

我读某处可能会使用valgrind的压缩文件,这有助于过滤掉不必要的泄漏,但是,我找不到它。

I read somewhere that is possibile to use a suppression files for valgrind which helps filtering out the unwanted leaks, but I can't find it.

我使用的是Ubuntu 11.04 x64,g ++ 4.5,Qt 4.7。
有人知道如何处理这个问题吗?

I'm using Ubuntu 11.04 x64, g++ 4.5, Qt 4.7. Does somebody know how to cope with this problem?

推荐答案

您看过这个Valgrind抑制文件Howtowiki

只是为了记录在Qt有一些底层库(特别是在绘画过程中),总是泄漏少量的内存。这些是你需要压制的。

Just for the record there are some underlying libraries in Qt (especially the ones in the painting process) which always leak small amount of memory. These are the one you need to suppress.

正如你所说,你应该首先创建一个最小的项目,运行它创建一个valgrind抑制文件,然后应用该抑制文件到您的项目。

As you said, you should first create a minimal project, run it to create a valgrind suppression file and then apply that suppression file to your project.

这篇关于用于Qt内存的抑制文件与Valgrind泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆