views:

58

answers:

1

Hello. I'm very interested in using Sun Studio to detect memory leaks in C++ applications with dbx debugger but I think this debugger only shows memory leaks produced by malloc/realloc and free; I'm not sure about this but I've tried with a C++ program and I've obtained no memory leaks. In this case, I'd try Valgrind. If I've done something wrong (high possibility) How do I debug C++ applications?

Thanks.

A: 

Well some points which you need to make sure,first,the application you traces do have any memory leak.if not then profiler won't show anything.If there is a leak and profiler is not capturing then need to check how you doing it. So valgrind is another best option you can try.So when you say "something wrong (high possibility) How do I debug C++ applications?" do you mean only relevant to debugging memory leak issue or in general debugging of C++ application?If its memory leak related then you can rely on valgrind,else you can also look at AIX malloc trace as well.Here is the URL for it:

http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.genprogc/doc/genprogc/malloc_trace_debug.htm

Anil Vishnoi
Thanks! I only refer to memory leaks. I know my code has memory leaks because Netbeans 6.8 detects eight of them but no more information. I use Linux and I'll try Valgrind, In fact, I've seen Valgrind needs glibc 2.0-2.10 and the version of glibc I've installed is 2.11. The first problem...
honnix