Which one is better on Linux? Valgrind or Purify What is your opinion of using them?
Using Memory Profilers Memory profilers are tools that can monitor memory usage and help detect memory leaks in an application. Profilers can also help with analyzing how resources are allocated within an application, for example how much memory and CPU time is being used by each method.
Valgrind reports two types of issues: memory errors and memory leaks. When a program dynamically allocates memory and forgets to later free it, it creates a leak. A memory leak generally won't cause a program to misbehave, crash, or give wrong answers, and is not an urgent situation.
Yes, there are false positives with Valgrind, that's why it has suppression files for particular glibc and gcc versions, for example. The false positives may arise if you are using older valgrind with newer gcc and glibc, i.e., valgrind 3.3 with glibc 2.9.
Valgrind uses instrumentation to collect information about allocated and freed memory to gather complete information about memory blocks. Many developers ask how to use Valgrind on Windows and Visual Studio.
I have used both and valgrind is the clear winner for me. Not only is it free and open source, but it is much easier to use because it requires no recompile or relink. I've also found that purify is much more likely to change the behavior of your program, even causing it to produce incorrect results when the program is correct.
The valgrind team conducted a survey where valgrind was compared to other tools, including Purify, and posted the results on their site. According to this it looks like the big plus for purify is the GUI. Valgrind does not come with a GUI but there are GUI front ends available. I prefer the text output myself.
Well, Valgrind is free and open source, which is a huge advantage.
I have used Valgrind before and it worked quite well. Unless there is a feature that Purify has that Valgrind doesn't and you absolutely need that feature, you should probably just go with Valgrind.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With