Projects/libsheap

From 757Labs

Contents

[edit]  libsheap

SHEAP (Sheap Helps Examine Allocated Pointers) is a simple heap analysis tool.

[edit]  About 

libsheap is a simple shared library to aid runtime heap analysis of an application. This library wraps malloc and free calls. The allocated data returned by the memory allocator is output as well as the amount of CPU cycles between calls to the true, underlying malloc implementation. If glibc's malloc, ptmalloc2, is used the actual size, including the header malloc attaches to each returned chunk is reported. The size of a returned chunk is typically more than that of what the user requests, as the extra size can help reduce fragmentation.

libsheap also has a CPU cycle counter which counts the cycles it takes between calls to the underlying (wrapped) malloc. This implementation is not terribly accurate as interrupts can occur between the start and return of that wrapped malloc.

Special thanks to Google and stackoverflow.com where I learned about wrapping routines in the GNU/Linux system. Much of the wrapping code here was paraphrased from Checker's answer to a post over at stackoverflow.com Thanks Checkers!

This project is released under the GNU LGPLv3 license. So take to your shears!

[edit]  News 

  • July 15, 2009 libsheap v0.1 is now released

[edit]  Downloads 

libsheap v0.1 (tar.gz) July 15, 2009

[edit]  Contact 

This project is maintained and written by Matt Davis (enferex). Questions, suggestions, comments, coffee dates welcome. Matt Davis (mattdavis9@gmail.com)