malloc-wrapper is an LD_PRELOAD'able shared library for tracking down memory leaks. It is suitable for use with C or Python, and perhaps other languages. It only tracks malloc() and free().

Because it is LD_PRELOAD'able, it can be used without recompiling the binary you want to examine.

See the included Makefile for usage examples; test-program.c is of course a C test program, and test-program2 is a Python test program.

It can be downloaded here.


Hits: 1650
Timestamp: 2024-12-27 07:43:34 PST

Back to Dan's tech tidbits

You can e-mail the author with questions or comments: