Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Valgrind vs Purify [closed]

Tags:

Which one is better on Linux? Valgrind or Purify What is your opinion of using them?

like image 407
godfryd Avatar asked Jul 27 '09 14:07

godfryd


People also ask

What is the best tool to detect memory leaks?

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.

What are the problems with valgrind?

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.

Can valgrind be wrong?

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.

Can I use valgrind for Visual Studio?

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.


2 Answers

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.

like image 152
mark4o Avatar answered Sep 22 '22 18:09

mark4o


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.

like image 27
Zifre Avatar answered Sep 22 '22 18:09

Zifre