A couple people here at work just came up against a bug in memory usage on an embedded platform. (This may be straining the definition of embedded in the size of the application, as it is large, but we’ll go with it.) The problem manifested as a failure in malloc. color palette . The debugging tool that allowed them to find it was simply to set the environment variable:
MALLOC_CHECK_=1
This tells glib to use a debug heap as opposed to the standard heap allocation routines. No recompile required.