473,549 Members | 2,573 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Memory leak detection tools?

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

Nov 2 '06 #1
8 8189
kk****@yahoo.co m 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.d evelopment.syst em

Nov 2 '06 #2
kk****@yahoo.co m 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.
Nov 2 '06 #3
kk****@yahoo.co m 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.progr ammer. Sun's dbx does the runtime part.

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

--
Ian Collins.
Nov 2 '06 #4
VJ
Jacek Dziedzic wrote:
kk****@yahoo.co m 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
Nov 3 '06 #5
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.
Nov 3 '06 #6
VJ wrote:
Jacek Dziedzic wrote:
>kk****@yahoo.co m 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.
Nov 3 '06 #7
VJ
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.
Shit 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 ;)
Nov 3 '06 #8
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.

Shit 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.
Nov 3 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7789
by: Sergey Tursanov | last post by:
Hello all ! When I use code below and check my program with various memory leak detection tools I get message about memory leaks in stl_alloc.h. #include <string> int main() { std::string s = ""; // that string of code causes memory leaks return 0;
8
2815
by: __jakal__ | last post by:
Hello, Is there any good memory leak detection software for C++ available as a freeware... I had used purify but had to discontinue due to huge license fees... Also tried Sun workshop memory monitor........its a kind of buggy as it doesnt detect most of the memory leaks. Cud anyone suggest some good memory leak detection software...
1
2312
by: Spur | last post by:
Hi all, I implemented a memory allocation/deallocation class that logs all new/delete calls (overloaded) and remembers for each allocated block where it was allocated from (using a macro that passes __FILE__ and __LINE__). On destruction, it reports all undeleted blocks (memory leaks). The class is implemented in a separate .h/.cpp...
3
6204
by: wavelet | last post by:
a.exe is one programming writen with c/c++ language. a.exe will be called multi-times by another programming. Now I want to check how much memory is used by a.exe or whether some memory leak happens . Is there any API interface availabe or tools for this purpose on both windows and Unix? RGS Wavelet
7
2647
by: mosaic | last post by:
Hi, all I really interested in how to check the memory leak of a program. Your smart guys, do you have excellent ideas that could share with me? Thank you. The following is my idea: In C programming language, there's a "malloc", there must a "free", my solution of the detection of leak is, find the corresponding "free" of "malloc". This...
0
3886
by: Frank Lopez | last post by:
Does anyone know if Microsoft generated a whitepaper on this topic? Does anyone know what the solution is? (meaning, eliminate the leak problem -- I am seeing three memory leaks from dllmodul.cpp(102) similar to what is mentioned below)... I am calling MFC as part of unmanaged code used by the managed code. +--------
3
1681
by: Peter Steele | last post by:
We're doing some development in VS .NET C++ and want to purchase a tool for memory leak detection and related activities. Any recommendations?
0
1716
by: Stephen Kellett | last post by:
Announcing Software Tools for Python We are pleased to inform you that we have completed the port and beta test of our Memory Analysis software tool to support Python. The software tools run on the Windows NT/2000/XP (and above) platforms. Python Memory Validator (a memory leak detection tool)...
16
5079
by: graham.keellings | last post by:
hi, I'm looking for an open source memory pool. It's for use on an embedded system, if that makes any difference. Something with garbage collection/defragmentation would be nice. It should have the ability to allocate different size chunks of memory not just a single size. It should error check for double free, etc. And it should be usable...
0
7459
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7726
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7967
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7819
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5097
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3488
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.