#37 LeakChaser, a Java memory leak detection tool

Harry Xu

In large programs written in managed languages such as Java and
C#, holding unnecessary references often results in memory leaks
and bloat, degrading significantly their run-time performance and
scalability. Despite the existence of many leak detectors for such
languages, these detectors often target low-level objects; as a result,
their reports contain many false warnings and lack sufficient
semantic information to help diagnose problems. This paper introduces
a specification-based technique called LeakChaser that can
not only capture precisely the unnecessary references leading to
leaks, but also explain, with high-level semantics, why these references
become unnecessary.

At the heart of LeakChaser is a three-tier approach that uses
varying levels of abstraction to assist programmers with different
skill levels and code familiarity to find leaks. At the highest tier
of the approach, the programmer only needs to specify the boundaries
of coarse-grained activities, referred to as transactions. The
tool automatically infers liveness properties of these transactions,
by monitoring the execution, in order to find unnecessary references.
Diagnosis at this tier can be performed by any programmer
after inspecting the APIs and basic modules of a program, without
understanding of the detailed implementation of these APIs. At the
middle tier, the programmer can introduce application-specific semantic
information by specifying properties for the transactions. At
the lowest tier of the approach is a liveness checker that does not
rely on higher-level semantic information, but rather allows a programmer
to assert lifetime relationships for pairs of objects. This
task could only be performed by skillful programmers who have
a clear understanding of data structures and algorithms in the program.

We have implemented LeakChaser in Jikes RVM and used it
to help us diagnose several real-world leaks. The implementation
incurs a reasonable overhead for debugging and tuning. Our case
studies indicate that the implementation is powerful in guiding programmers
with varying code familiarity to find the root causes of
several memory leaks—even someone who had not studied a leaking
program can quickly find the cause after using LeakChaser’s
iterative process that infers and checks properties with different levels
of semantic information.


  • Harry Xu

    Harry Xu - 2011-03-21

    The implementation of LeakChaser on Jikes RVM 3.1.0

  • Harry Xu

    Harry Xu - 2013-07-15

    This material is based upon work supported by the National Science
    Foundation under Grant Number CCF-1017204. Any opinions, findings, and
    conclusions or recommendations expressed in this material are those of the
    author(s) and do not necessarily reflect the views of the National Science

  • Harry Xu

    Harry Xu - 2013-07-16

    This work was supported in part by an IBM Ph.D. fellowship award.


Log in to post a comment.