如何使用的valgrind查找内存泄漏? [英] How do I use valgrind to find memory leaks?

查看:149
本文介绍了如何使用的valgrind查找内存泄漏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何使用的valgrind查找程序中的内存泄漏?

How do I use valgrind to find the memory leaks in a program?

请帮助我的人,描述的步骤结转库存的程序?

Please someone help me and describe the steps to carryout the procedure?

我使用Ubuntu 10.04和我有一个程序交流转换器,请帮助我。

I am using Ubuntu 10.04 and I have a program a.c, please help me out.

推荐答案

试试这个:

的valgrind --leak检查=全-v ./your_program

只要Valgrind是安装它会经过你的程序,并告诉你什么是错的。它可以给你的指针和你在哪里泄漏可能会发现近似的地方。如果你segfault'ing,试图通过 GDB 运行它。

As long as valgrind is installed it will go through your program and tell you what's wrong. It can give you pointers and approximate places where your leaks may be found. If you're segfault'ing, try running it through gdb.

问候,

丹尼斯·米

Regards,
Dennis M.

这篇关于如何使用的valgrind查找内存泄漏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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