Check out the new USENIX Web site. next up previous
Next: Measurements Up: Are Mallocs Free of Previous: GNU Emacs and Its


Dynamic Memory Activity Trace

The dynamic memory activity trace was captured from Hummingbird and GNU Emacs runs as described in Sections 2 and 3 above. The Hummingbird trace contained about 58 million events (dynamic memory allocations and deallocations) while the Emacs trace contained about 20 million events.

The memory activity trace is a text file. Each line in the file corresponds to either a memory allocation or deallocation operation. The format of the trace lines is:


Allocate <tag> <size> 

Free <tag>

The tag field is used to match the memory allocation with the corresponding memory deallocation operation. We used the virtual address of the allocated area in the instrumented program as the tag. Of course, when we run the trace with different mallocs on different operating systems, the memory allocations will results in different virtual addresses than the tags in the trace file. However, the tags can still be used to match the malloc operations with the corresponding free operations.

An alternate implementation of the trace file might have used the allocation sequence number as the tag. In other words, the first allocated memory object will get tag # 1, the second will get tag # 2, etc. We did not implement this option since it necessitates auxiliary data structures in the trace generation routines, which may perturb the measured application. However, it is easy to generate this alternate trace format by post-processing the current trace file format.

We wrote a simple driver program that reads the trace and calls the corresponding malloc and free based on the current trace file entry. The driver program keeps a hash table with the tags of all live memory objects. In this way, it can locate the corresponding memory object for the free operation given its tag.


next up previous
Next: Measurements Up: Are Mallocs Free of Previous: GNU Emacs and Its