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: 1382
Timestamp: 2024-04-16 08:43:55 PDT

Back to Dan's tech tidbits

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