Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Memory leak detection tools?

Reply
Thread Tools

Memory leak detection tools?

 
 
kk_oop@yahoo.com
Guest
Posts: n/a
 
      11-02-2006
Hi. Any recommendations for memory leak detection tools for C++ running
on Linux or Solaris? I'm interested in static (compile time) and
runtime detection. It's for a large project.

Thanks!

Ken

 
Reply With Quote
 
 
 
 
Larry Smith
Guest
Posts: n/a
 
      11-02-2006
wrote:
> Hi. Any recommendations for memory leak detection tools for C++ running
> on Linux or Solaris? I'm interested in static (compile time) and
> runtime detection. It's for a large project.
>
> Thanks!
>
> Ken
>


Try the newsgroup

comp.os.linux.development.system

 
Reply With Quote
 
 
 
 
Jacek Dziedzic
Guest
Posts: n/a
 
      11-02-2006
wrote:
> Hi. Any recommendations for memory leak detection tools for C++ running
> on Linux or Solaris? I'm interested in static (compile time) and
> runtime detection.


For runtime detection, without the need to recompile,
you might try valgrind, if it is supported on your platform.

> It's for a large project.


That might be difficult -- programs run under valgrind
during debugging tend to consume memory and CPU power
in the order of ten times the original program.
But worth a try.

HTH,
- J.
 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      11-03-2006
wrote:
> Hi. Any recommendations for memory leak detection tools for C++ running
> on Linux or Solaris? I'm interested in static (compile time) and
> runtime detection. It's for a large project.
>

Try comp.unix.programmer. Sun's dbx does the runtime part.

Use of your own operator new can also provide run time data.

--
Ian Collins.
 
Reply With Quote
 
VJ
Guest
Posts: n/a
 
      11-03-2006
Jacek Dziedzic wrote:
> wrote:
>
>> Hi. Any recommendations for memory leak detection tools for C++ running
>> on Linux or Solaris? I'm interested in static (compile time) and
>> runtime detection.

>
>
> For runtime detection, without the need to recompile,
> you might try valgrind, if it is supported on your platform.


valgrind is supported on linux

>
>> It's for a large project.

>
>
> That might be difficult -- programs run under valgrind
> during debugging tend to consume memory and CPU power
> in the order of ten times the original program.
> But worth a try.
>


If he makes small unit tests, he can use valgrind on those, and at the
same time test both unit tests and his code

I agree it is much slower then normal compilation
 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      11-03-2006
VJ wrote:
>
> If he makes small unit tests, he can use valgrind on those, and at the
> same time test both unit tests and his code
>

If he has the good sense to produce decent unit tests, adding operator
new() and delete() to the test harness will serve him well. No need for
anything else.

--
Ian Collins.
 
Reply With Quote
 
Jacek Dziedzic
Guest
Posts: n/a
 
      11-03-2006
VJ wrote:
> Jacek Dziedzic wrote:
>
>> wrote:
>>
>>> Hi. Any recommendations for memory leak detection tools for C++ running
>>> on Linux or Solaris? I'm interested in static (compile time) and
>>> runtime detection.

>>
>>
>>
>> For runtime detection, without the need to recompile,
>> you might try valgrind, if it is supported on your platform.

>
>
> valgrind is supported on linux


Yes, but not for all architectures, like IA-64, for instance.

- J.
 
Reply With Quote
 
VJ
Guest
Posts: n/a
 
      11-03-2006
Ian Collins wrote:
> VJ wrote:
>
>>If he makes small unit tests, he can use valgrind on those, and at the
>>same time test both unit tests and his code
>>

>
> If he has the good sense to produce decent unit tests, adding operator
> new() and delete() to the test harness will serve him well. No need for
> anything else.
>


**** happens, cause noone is perfect, therefore testing for memory leaks
in unit tests is not bad, just takes time and should not be used often.

Murphies law rules everywhere
 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      11-03-2006
VJ wrote:
> Ian Collins wrote:
>
>> VJ wrote:
>>
>>> If he makes small unit tests, he can use valgrind on those, and at the
>>> same time test both unit tests and his code
>>>

>>
>> If he has the good sense to produce decent unit tests, adding operator
>> new() and delete() to the test harness will serve him well. No need for
>> anything else.
>>

>
> **** happens, cause noone is perfect, therefore testing for memory leaks
> in unit tests is not bad, just takes time and should not be used often.
>

I think you miss my point, if you provide your own memory manager, you
can have memory leak detection almost free, just by keeping tabs on all
allocated blocks.

The same applies with Sun's dbx, there is next to no overhead running
with memory leak detection enabled. Access violation detection is an
other story.

--
Ian Collins.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
c++ memory leak detection __jakal__ C++ 9 05-24-2012 08:39 PM
Memory Leak Detection Winbatch C++ 11 04-15-2009 01:57 PM
Memory Leak detection Archana C++ 1 02-04-2008 07:16 AM
About memory leak detection. mosaic C Programming 7 07-16-2004 01:42 PM
memory allocation logging for leak detection - problem with globals Spur C++ 1 05-09-2004 09:46 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57