MemInfo is a command line tool to help locate and fix various memory errors in C programs. Includes two main components: gccmeminfo and meminforeport. gccmeminfo acts as a wrapper for gcc, adding several compile-time flags automatically. When the program compiled with gccmeminfo runs, it will produce a file named meminfoXXX.out with statistical information, where XXX is the pid of the process. Running meminforeport meminfoXXX.out will print a detailed description of all detected memory errors found in the program. Some of the memory errors detected are:
- Un-freed memory
- Double or invalid frees
- Referencing recently freed memory
- Using memory before or after the allocated space returned by m/calloc
The report will tell you exactly where the error was detected (if applicable), where that memory was initially allocated, and other information. Statistics showing how much memory was allocated or deallocated at every line and file is also printed.
A version which tracks memory problems in C++ and Objective-C (in addition to C) is in the works.
Source code is included, and comments/criticisms are welcome.
View the website (http://homepage.mac.com/rliljest/downloads/c/meminfo/index.html) for more information.