|Producing memory traces of C storage allocation? email@example.com (2001-06-28)|
|Re: Producing memory traces of C storage allocation? firstname.lastname@example.org (Joachim Durchholz) (2001-07-02)|
|Re: Producing memory traces of C storage allocation? email@example.com (Graeme Roy) (2001-07-02)|
|Re: Producing memory traces of C storage allocation? firstname.lastname@example.org (2001-07-02)|
|Re: Producing memory traces of C storage allocation? email@example.com (Friedrich Dominicus) (2001-07-17)|
|From:||Graeme Roy <firstname.lastname@example.org>|
|Date:||2 Jul 2001 00:30:54 -0400|
|Organization:||Analog Devices, Inc.|
|Posted-Date:||02 Jul 2001 00:30:54 EDT|
The mpatrol toolkit is capable of logging, profiling and tracing all calls
to C/C++ memory allocation routines for a given program, and can produce
statistics about the overall allocation behaviour for specific runs.
On UNIX and Windows it can trap all calls to malloc(), free(), etc, even
ones originating from library routines (although Windows DLLs will need
to be recompiled with support for mpatrol). Unfortunately, it does not
catch calls to sbrk(), mmap() or VirtualAlloc() so if your application
uses these directly then you may need to resort to commercial heap
Changing a compiler to log calls to malloc() and free() would have exactly
the same effect as wrapping such calls using the preprocessor and a
special header file. However, performing the wrapping at link time
allows you to catch calls from third party libraries rather than calls
from just the object files that were recompiled with tracing enabled.
The mpatrol toolkit is located at:
A list of over 80 items of related software (for detecting memory leaks,
heap corruption, memory usage profiling) can be found at:
If you find that mpatrol does not meet your requirements, you're bound to
find something in the above list that will be suitable.
On 28 Jun 2001, Corndog wrote:
> Hmm..this is quite the question Im sure, but does anyone know of a C
> compiler or is anyone able to tell me how to create one (roars of
> laughter) that is able to force the program being generated to log all
> calls to memory allocation routines like malloc and free in order for
> me to be able to determine the size of the heap at any point during
> the program execution?
Return to the
Search the comp.compilers archives again.