Debugging is still an art, not a science; but there are some techniques that can help. This site shares several techniques to help iPhone and iPad developers to debug program codes effectively.
Malloc Stack Logging
Record stack logs for each memory block to assist memory debugging tool.