我这个保证你满意,用leaky.
Once your program has completed execution you can use leaky to look for memory leaks, or at least use it to dump the log. For memory leaks, you use leaky like this:
leaky -d <program-name-goes-here> malloc-logLeaky will then display all of the call sites where memory was leaked. To look at the entire log file contents, not just the leaks add "-a" to the arguments: leaky -d -a <program-name-goes-here> malloc-log