内存泄漏程序 [英] Memory Leak Programs

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

问题描述

大家好,


我使用''Valgrind'来修复程序的内存泄漏。我是

寻找其他程序,看看他们是如何发现问题的。

你们有没有使用过其他程序的经验?

如果您认为您正在使用的程序是

a检测内存泄漏的好工具,请告诉我。


谢谢,

Mohsen

解决方案

c语言:


I我使用''Valgrind'来修复程序的内存泄漏。我是

寻找其他程序,看看他们是如何发现问题的。

你们有没有使用过其他程序的经验?

如果您认为您正在使用的程序是

a检测内存泄漏的好工具,请告诉我。



这是一个想法。 。 。


Hijack" malloc"和免费。


每次分配内存时,记下它并记录源文件

和行号。每次释放内存时,请记下它的
释放。


当程序结束时,打印出所有没有<分配的分配br />
相应的重新分配。


更好的是,在编程时要注意。


-


Frederick Gotham


文章< 11 ****************** ****@f16g2000cwb.googlegroups .com> ;,

c language< ja ******* @ gmail.comwrote:


>我正在使用''Valgrind'来修复程序的内存泄漏。我正在寻找其他程序,看看他们是如何发现问题的。
你们有没有使用过其他程序的经验?
如果你觉得你的程序,请告诉我。正在使用是一个检测内存泄漏的好工具。



商业程序Purify可以非常有用地跟踪内存泄漏和下标错误以及其他几种
问题。它并不便宜,而且它不是你每天都需要的东西,

但是当你需要它时,它可以真正保存你的基础。


Purify来自Rational系列,现在由IBM拥有。

-

那时候我很年轻,但我也很朦胧。

- Christopher Priest




Frederick Gotham写道:


c语言:


我正在使用''Valgrind'来修复程序的内存泄漏。我是

寻找其他程序,看看他们是如何发现问题的。

你们有没有使用过其他程序的经验?

如果您认为您正在使用的程序是

a检测内存泄漏的好工具,请告诉我。




这是一个想法。 。 。


Hijack" malloc"和免费。


每次分配内存时,记下它并记录源文件

和行号。每次释放内存时,请记下它的取消分配。



我不知道怎么做


>

当程序结束时,打印出所有没有

相应解除分配的分配。



我不知道怎么做


>

更好,在编程时要注意。


-


Frederick Gotham


Hello all,

I am using ''Valgrind'' to fix the memory leaks of my programs. I am
looking for other programs to see how they are detecting the problems.
Does any of you have experience in working with othere programs?
Please let me know if you feel the program that you are working with is
a good tool to detect the memory leaks.

Thanks,
Mohsen

解决方案

c language:

I am using ''Valgrind'' to fix the memory leaks of my programs. I am
looking for other programs to see how they are detecting the problems.
Does any of you have experience in working with othere programs?
Please let me know if you feel the program that you are working with is
a good tool to detect the memory leaks.


Here''s an idea. . .

Hijack "malloc" and "free".

Every time memory is allocated, keep a note of it and record the source file
and line number. Every time memory is deallocated, take note of its
deallocation.

When the program ends, print out all the allocations which didn''t have a
corresponding deallocation.

Better yet, pay attention when you''re programming.

--

Frederick Gotham


In article <11**********************@f16g2000cwb.googlegroups .com>,
c language <ja*******@gmail.comwrote:

>I am using ''Valgrind'' to fix the memory leaks of my programs. I am
looking for other programs to see how they are detecting the problems.
Does any of you have experience in working with othere programs?
Please let me know if you feel the program that you are working with is
a good tool to detect the memory leaks.

The commercial program "Purify" can be very useful in tracking
memory leaks and subscript errors and several other kinds of
problems. It isn''t cheap, and it isn''t something you need every day,
but when you need it, it can really save your fundament.

Purify is from the Rational line, now owned by IBM.
--
I was very young in those days, but I was also rather dim.
-- Christopher Priest



Frederick Gotham wrote:

c language:

I am using ''Valgrind'' to fix the memory leaks of my programs. I am
looking for other programs to see how they are detecting the problems.
Does any of you have experience in working with othere programs?
Please let me know if you feel the program that you are working with is
a good tool to detect the memory leaks.



Here''s an idea. . .

Hijack "malloc" and "free".

Every time memory is allocated, keep a note of it and record the source file
and line number. Every time memory is deallocated, take note of its
deallocation.

I don''t know how to do this

>
When the program ends, print out all the allocations which didn''t have a
corresponding deallocation.

I don''t know how to do this

>
Better yet, pay attention when you''re programming.

--

Frederick Gotham


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

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