Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Unfortunately, Valgrind does not support OS X 10.8 yet. After some Googling, I came across some forum posts where people were able to get it to compile and "almost" link. Does anyone know of any good alternatives to Valgrind for memory leak detection?

share|improve this question
up vote 1 down vote accepted

Assuming you can be bothered, if you install MacPorts you will be able to install a functioning Valgrind (3.8.1 as for today) on your system. Unfortunately MacPorts will require you to install the whole XCode, not just the CL tools, so YMMV.

share|improve this answer
I came back to this question to post this information myself; I use MacPorts and realized that Valgrind now works. – void-pointer Jan 24 '13 at 12:39

While valgrind can be installed, the current state isn't very usable. In a simple program I got the following result;

==16016== HEAP SUMMARY:
==16016==     in use at exit: 63,264 bytes in 364 blocks
==16016==   total heap usage: 516 allocs, 152 frees, 67,154 bytes allocated
==16016== LEAK SUMMARY:
==16016==    definitely lost: 8,624 bytes in 14 blocks 
==16016==    indirectly lost: 1,168 bytes in 5 blocks
==16016==      possibly lost: 4,933 bytes in 68 blocks
==16016==    still reachable: 48,539 bytes in 277 blocks
==16016==         suppressed: 0 bytes in 0 blocks
==16016== Rerun with --leak-check=full to see details of leaked memory
==16016== For counts of detected and suppressed errors, rerun with: -v
==16016== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

The same code will be fine with using valgrind on a linux.(compiled on their respective systems)

share|improve this answer

The Instruments app (part of Xcode) is a very good way to look for leaks and run stress tests on the memory allocation of a running program.

share|improve this answer
Can you give some samples about how one could use Instruments to do the same thing as valgrind? – patrix Nov 5 '12 at 17:56
See this thread for instance. Personnally, I still have issue on my new mac book pro retina which display unknown processor in the counter instrument yet it may work for you. – Sebastien Varrette Nov 14 '12 at 9:21

Your Answer


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.