To audit memory or to debug with external tools it can be useful to get a dump of the running memory of an app.
To do so on a device you'll need a Jailbreak, SSH access, and gdb
. See this or this.
If instead you're up to a simulated app, things are easier: apps running in the simulator are actually just native processes on your Mac OS X.
So, how to get a core dump of a Mac OS X process? Sadly gdb can't do so. Mac OS X Internals comes to the rescue with this article.