A dynamic approach to locating memory leaks

Date of this Version


Document Type

Journal Article

Publication Details

Citation only

Vorobyov, K., Krishnan, P., & Stocks, P. (2013). A dynamic approach to locating memory leaks. Lecture notes in Computer Science, 8254, 255-270.

Access the journal

2013 HERDC submission. FoR code: 080308; 080309

© Copyright, IFIP International Federation for Information Processing, 2013




We present a dynamic approach to memory leak detection and reporting to aid the debugging process. We track memory allocations and aliases during execution, which allows us not only to detect leaks, but also locate the point of the leak in the source code. The level of tracking can be customised by the user. This analysis is safe in the presence of pointer aliasing - a benefit of the dynamic approach, as such problems are hard to solve using static analysis (or lead to many false positives). Our technique works by instrumenting programs with statements that track memory allocations, capture alias information, and monitor potential leaks. By tracking only location and size of memory allocation, rather than monitoring every bit, as is common in other approaches, we keep memory overhead very low. We demonstrate the applicability of our approach on a number of open-source programs and a few SPEC CPU benchmarks. Our experiments show that the overheads compare favourably with current analysis tools such as Valgrind.



This document has been peer reviewed.