From f9e93c4b6436fa62489add737e1c488dff7fd4aa Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 5 Mar 2012 15:08:59 +1100 Subject: [PATCH] README --- README | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..770e094 --- /dev/null +++ b/README @@ -0,0 +1,16 @@ +This is a very simple memory leak detector using libexecinfo (in +OpenBSD ports as devel/libexecinfo). It could be adapted to use the +backtrace function in glibc too. + +It tracks memory allocations by redirecting malloc/free and friends +to its own functions using preprocessor defines. When an allocation +is made, leakmalloc grabs the call chain from the stack and stores it. +When the program exits, leakmalloc dumps all unfreed allocations. + +leakresolve.py consumes one of these dumps and produces a fairly +readable report with leaks coalesced by stack trace and sorted by +number of leak instances. Usually the last entry on this report is +the one to care most about. + +The example in example/ shows how you might use it. Note that everything +needs to be compiled without optimisation and with debugging symbols.