Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

As C++ devs, what tools outside your IDE do you use to optimize and detect potential problems with your code?

Also, what are their main strengths, i.e. why did you choose them over other tools ?

share|improve this question

8 Answers

up vote 9 down vote accepted

On any *nix system, use valgrind. On Windows, use AppVerif.

share|improve this answer
Valgrind rules! – Khelben Nov 7 '10 at 11:02
Why people use PC(Personal Computer) as a synonym of PC with Microsoft Windows? – hiena Nov 7 '10 at 12:41
@hiena, that's a valid point. I changed it to Windows in the original post. – JSBձոգչ Nov 8 '10 at 15:45
1  
For profiling, valgrind is better than gprof mostly because gprof can't profile shared libraries. To get a visual representation of the graph produced by "callgrind" (the specific tool in valgrind for profiling), you can use kcachegrind. – jsternberg Nov 8 '10 at 17:22

For detecting leaks, I'll defer to others.

For finding performance problems,

  • for outside the IDE, for Linux, I'm impressed by Zoom

  • for outside any IDE - well, IMHO, there is no technique outside the IDE as effective, nor as ugly, as the one inside the IDE, namely random pausing. For a lot of reasons. Here's an example of using it to get a 43x speedup. If you want something attractive, look elsewhere. If you want results, it just works.

share|improve this answer
+1 - your random pausing seems like a great concept while being as simple as can be. – Jas Nov 8 '10 at 20:13
+1 for Zoom on Linux - see also Shark on Mac OS X – Paul R Nov 8 '10 at 22:01

AQTime to find bottlenecks, memory problems and lots of other things. Also I worked for a company where we used PC-Lint for static analysis.

share|improve this answer

I've used IBM/Rational Purify (for memory leaks) and Quantify, which is now called PurifyPlus. (This was several years ago, before I made a switch from C++ to .NET.)

I used them on Windows as well as on Solaris and was happy with the performance improvements that resulted from the use of these products.

share|improve this answer

I use VLD on Visual C++. It's simple and free.

share|improve this answer

In Windows umdh(user-mode dump heap) from Debugging Tools for Windows is free and helps to find memory leaks.

share|improve this answer

AMD CodeAnalyst for performance analysis. It's free, integrates to Visual Studio (but works standalone as well). Despite its producer, it works fine also on Intel processors.

MemoryValidator from SoftwareVerify is a great tool for memory bug tracking. It's quite costly but definitely worth the money - easy to use, no need to recompile/relink your code and has a plenty of features.

On my Linux machine I use Valgrind for all the memory bug tracking - it's great and there's no real competition for it.

share|improve this answer

I didn't tried it yet but with Visual Studio, Visual Leak Detector seems to be popular: http://sites.google.com/site/dmoulding/vld

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.