Trackalloc - a lightweight heap profiler

by Travis McLeskey (travis -at- mcleskey -dot- org)

News | Description | Trackalloc vs. the (many) alternatives | Download

News

Description

Trackalloc wraps the ISO C memory functions with functions that keep records of current allocations. These records can be written to files at selected points in the program under test. The files can then be summarized using the included generate_stats.pl script. Output from this script looks a little like this:

    size of outstanding allocations made at addHashEntry.c:70 (malloc):

    125664 |                 *
           |             ****
           |           ***
           |          ***
           |    *    **
           |   ***  **
           | ***  ***
    106368 |**
           |------------------
            0               50
  

Trackalloc is especially useful for seeing where and when your program is using and leaking memory.

Trackalloc vs. the (many) alternatives

Pros:

Cons:

Download

SourceForge.net Logo

Copyright (c) 2004 Travis McLeskey