Sign in to follow this  

detecting memory leaks in mac os x

This topic is 3664 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm developing a C application in MacOS X. What can I use to check my application for memory leaks? I've tried MallocDebug, but I'm getting "Unable to read malloc information from (null)". Plus, there's no Valgrind :( . Thanks

Share this post


Link to post
Share on other sites
I don't know, but if you don't get the info you need here you might also try asking over at idevgames.com.

Any particular reason you're stuck with C? Memory leaks are generally not an issue in a well-implemented C++ application (and they're even less of an issue in some other languages).

Share this post


Link to post
Share on other sites
My memory manager code

You'll need to edit it slightly to remove the stack trace stuff (Since it uses Win32 functions), and you'll need to remove / comment out the Assert()s and Log()s, but otherwise it should work fine. Or just use it as a reference for writing your own memory manager.

All it does it keep track of all allocations (By overriding global new/new[]/delete/delete[]) and spew out active allocations at program shutdown time.

Share this post


Link to post
Share on other sites

This topic is 3664 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this