Newbie question: test memory leaks 
Author Message
 Newbie question: test memory leaks

I am new to memory leak problems in C programming. My question is how can
i test memory leaks in my code in a simple way. Is there any free tools to
do that ?

thanks a lot,

Jin
--



Sun, 06 Apr 2003 03:00:00 GMT  
 Newbie question: test memory leaks

Quote:

> I am new to memory leak problems in C programming. My question is
> how can i test memory leaks in my code in a simple way. Is there any
> free tools to do that ?

Yes, you can use the Boehm garbage collector as a memory leak
detector.

    http://reality.sgi.com/boehm/gc.html

It's very nice.  With the stable version, you compile it as a leak
detecting library.

You then use some preprocessor "#define"'s to have your program use
the Boehm gc leak detecting versions of malloc, free, etc., call the
garbage collection routine, and you get a printout on stderr showing
where the leaks were allocated.

--
--Ed Cashin                     PGP public key:

    Note: If you want me to send you email, don't munge your address.
--



Mon, 07 Apr 2003 03:00:00 GMT  
 Newbie question: test memory leaks

Quote:
>I am new to memory leak problems in C programming. My question is how can
>i test memory leaks in my code in a simple way. Is there any free tools to
>do that ?

Did you try the ones mentioned in the FAQ?

Dan
--
Dan Pop
CERN, IT Division

Mail:  CERN - IT, Bat. 31 1-014, CH-1211 Geneve 23, Switzerland
--



Mon, 07 Apr 2003 03:00:00 GMT  
 Newbie question: test memory leaks

Quote:

> I am new to memory leak problems in C programming. My question is how can
> i test memory leaks in my code in a simple way. Is there any free tools to
> do that ?

Lots of'em. Some extremely thorough (like ElectricFence or
Checker-gcc), others relatively simplistic (dbmalloc() and others). It
also depends on the hardware and OS you're coding on. You'll be better
off asking this again in a platform-specific newsgroup, I think.
--

Even if all the snow were burnt, ashes would remain.
--



Mon, 07 Apr 2003 03:00:00 GMT  
 Newbie question: test memory leaks
Hi,

there is a tool named memprof, which you can download from redhat or
helix-code.

greets

jens
--



Mon, 07 Apr 2003 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Newbie question about memory leak!

2. newbie question on memory leaks

3. How do I test for memory leaks

4. memory leak test

5. C torture test, memory leak, etc.

6. How to test memory leaks?

7. Testing for Memory Leaks in a DLL

8. Testing for memory leaks

9. Newbie needs help with memory leak

10. Newbie: SysReAllocStringLen in OLEAUT32.DLL memory leak.

11. Newbie: Memory Leaks detection help

12. NewBie: Memory leaks

 

 
Powered by phpBB® Forum Software