4 ms·
what's the difference between this and valgrind?
by ryanmccullagh 4y ago
what's the difference between this and valgrind?
- projektfu 4y agoA major difference is that purify is a binary transformation performed before or after linking. Valgrind/memcheck is a virtual machine that jit-compiles executable code and adds its instrumentation in the process. So, with purify, your linked executable includes the checks. With valgrind, the unmodified executable can run with or without checks.
- GuB-42 4y agoAnd for a more practical comparison: https://valgrind.org/gallery/survey_03/q4.html https://valgrind.org/gallery/survey_03/q4.html The takeout is: valgrind is free and doesn't require recompilation, purify has a more complete UI, they both have similar performance impact and bug-finding abilities.
- projektfu 4y agoAlso, Purify runs on Windows.
- wallstprog 4y agoI used Purify back in the day, and while it worked well, getting it working was a royal PITA. IIRC it was necessary to recompile EVERYTHING with Purify. Anyway, I would think the gold standard these days is clang's Address Sanitizer (https://github.com/google/sanitizers/wiki/AddressSanitizer https://github.com/google/sanitizers/wiki/AddressSanitizer). clang/ASAN also runs on Mac in addition to Linux.
- kccqzy 4y agoHaving never used Purify back in the day, I really wonder, do you think address sanitizer is an adequate or better replacement for Purify?
- wallstprog 4y agoIt's been a while, but IIRC ASAN catches most/all of the memory-related errors that Purify did. Purify did have a debugger-like GUI that would break on errors, which could be handy. valgrind can also do most of the same checks, but is much slower. On my team we use both