Leakbot Memory Analysis


Despite Java's automatic reclamation of memory, memory leaks remain an important problem. For example, we frequently encounter memory leaks that cause production servers to crash. These servers represent an increasingly common class of Java applications: they are large scale and they make heavy use of frameworks. For these applications, existing tools require too much expertise, and, even for experts, require many hours interpreting low-level details. In addition, they are often too expensive to use in practice. We have developed an automated, adaptive, and scalable tool for diagnosing memory leaks, called LeakBot.

LeakBot incorporates three new techniques. First, it automatically ranks data structures by their likelihood of containing leaks. This process dramatically prunes the set of candidate structures, using object reference graph properties and knowledge of how leaks occur. Second, it identifies suspicious regions within those data structures, and characterizes their expected evolution. Third, it uses the first two methods to derive a lightweight way to track those regions' actual evolution as the program runs. These techniques are mutually beneficial: we need only monitor what is highly ranked, and, because the tracking is so cheap, a region's rank can be continually updated with information from production machines. Finally, this whole process operates without user assistance.

As part of the ongoing consulting practice our group maintains, we continue to test LeakBot's effectiveness on the applications we encounter. To date, we have found that the ranking analysis scales (e.g. written in Java, it analyzes one million objects in 30 seconds with a 300M heap), is selective (e.g. it prunes that set to three candidate leak roots), and is accurate (it discounts non-leaking roots). The region generation completes in tens of seconds. The lightweight tracking refines the rankings, while lowering throughput by less than 5%.





Last updated 11 Apr 2007

Researchers



Research labs involved