This article is from the Mac Programming FAQ, by Jon Watte email@example.com with numerous contributions by others.
Get ahold of, and install, the extensions DoubleTrouble,
DisposeResource and EvenBetterBusError. They will catch 80% of any
memory related bugs you may have, including many bugs that follow NULL
handles or pointers. (Jasik's Debugger (see above) obviates the need
A low-level debugger is required, and while you install it, install the
"leaks" dcmd which will help you catch memory leaks in your application.
All of these tools are available from <ftp.apple.com>.