On Jun 12, 2009, at 9:29 PM, Ryan Joseph wrote:
I have just learned about the "leaks" unix utility for detecting memory leaks but I'm not unix savvy enough to understand a point mentioned in the man page. Which is:

"If the MallocStackLogging environment variable was set when the application was launched, leaks also displays a stack trace describing where the buffer was allocated."

Can anyone who uses this utility tell me how to set the this environment variable? I'm thinking it's possible this must be set via GDB, otherwise I'm not sure where it could get a stack trace from. Thank you for helping.

Environment variables can be set in your shell; the syntax depends on which shell you use. You can also set environment variables when you launch the app inside gdb:

    (gdb) set env MallocStackLogging 1
    (gdb) run

For more information about malloc stack logging, read this:
    Mac OS X Debugging Magic
    http://developer.apple.com/technotes/tn2004/tn2124.html


--
Greg Parker     gpar...@apple.com     Runtime Wrangler

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to