Skip to main content

LeakBot: An Automated and Lightweight Tool for Diagnosing Memory Leaks in Large Java Applications

  • Conference paper
ECOOP 2003 – Object-Oriented Programming (ECOOP 2003)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2743))

Included in the following conference series:

Abstract

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 present 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 uses Coevolving Regions to identify suspicious regions within a data structure and characterize 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 can be done without user assistance.

We demonstrate LeakBot’s effectiveness on a number of large-scale applications that we have analyzed as part of the ongoing consulting practice our group maintains. We have found that the ranking analysis scales (e.g. written in Java, it analyzes 106 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 CER generation completes in tens of seconds. The lightweight tracking refines the rankings, while lowering throughput by less than 5%

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Agesen, O., Detlefs, D., Moss, J.E.B.: Garbage collection and local variable type-precision and liveness in Java virtual machines. In: Programming Language Design and Implementation (1998)

    Google Scholar 

  2. Appel, J.K.A.W.: Traversal-based visualization of data structures. In: Symposium on Information Visualization, pp. 11–18 (1998)

    Google Scholar 

  3. Barach, D.R., Taenzer, D.H., Wells, R.E.: A technique for finding storage allocation errors in c-langage programs. ACM SIGPLAN Notices 17(5) (May 1982)

    Google Scholar 

  4. Borland software corporation optimizeitTM

    Google Scholar 

  5. Boyapati, C., Lee, R., Rinard, M.: Ownership types for safe programming: preventing data races and deadlocks. In: Object-oriented programming, systems, languages, and applications (2002)

    Google Scholar 

  6. Clarke, D., Noble, J., Potter, J.: Simple ownership types for object containment. In: European Conference on Object-Oriented Programming (2001)

    Google Scholar 

  7. Dong, J.S., Duke, R.: The geometry of object containment. Object-oriented Systems 2, 41–63 (1995)

    Google Scholar 

  8. Ernst, M., Griswold, W.G., Kataoka, Y., Notkin, D.: Dynamically discovering pointer-based program invariants. In: International Conference on Software Engineering (1999)

    Google Scholar 

  9. Hangal, S., Lam, M.S.: Tracking down software bugs using automatic anomaly detection. In: International Conference on Software Engineering (May 2002)

    Google Scholar 

  10. The Glasgow Haskell compiler user’s guide, http://haskell.cs.yale.edu/ghc

  11. Hastings, R., Joynce, B.: Purify — fast detection of memory leaks and access errors. In: USENIX Proceedings, pp. 125–136 (1992)

    Google Scholar 

  12. Hayes, B.: Using key object opportunism to collect old objects. In: Object-oriented programming, systems, languages, and applications (1991)

    Google Scholar 

  13. Hirzel, M., Diwan, A., Hosking, A.: On the usefulness of liveness for garbage collection and leak detection. In: European Conference on Object-Oriented Programming (2001)

    Google Scholar 

  14. Hirzel, M., Hinkel, J., Diwan, A., Hind, M.: Understanding the connectivity of heap objects. In: International Symposium on Memory Management (2002)

    Google Scholar 

  15. http://java.sun.com/products/jdk/1.2/docs/guide/jvmpi/jvmpi.html

  16. Lencevicius, R.: On-the-fly query-based debugging with examples. In: Automated and Algorithmic Debugging (2000)

    Google Scholar 

  17. Muchnik, S.S.: Advanced Compiler Design and Implemtnation. Morgan Kaufmann, San Francisco (1997)

    Google Scholar 

  18. Pauw, W.D., Jensen, E., Mitchell, N., Sevitsky, G., Vlissides, J., Yang, J.: Visualizing the execution of Java programs. In: Diehl, S. (ed.) Dagstuhl Seminar 2001. LNCS, vol. 2269, p. 151. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  19. Pauw, W.D., Sevitsky, G.: Visualizing reference patterns for solving memory leaks in Java. Concurrency: Practice and Experience 12, 1431–1454 (2000); Previously appeared in ECOOP 1999

    Article  MATH  Google Scholar 

  20. Ramalingam, G.: On loops, dominators, and dominance frontiers. ACM Transactions on Programming Languages and Systems 24(5), 455–490 (2002)

    Article  Google Scholar 

  21. Rational software corporation quantifyTM

    Google Scholar 

  22. Rojemo, N., Runciman, C.: Lag, drag, void and use — heap profiling and space-efficient compilation revisited. In: International Conference on Functional Programming, pp. 34–41 (1996)

    Google Scholar 

  23. Runciman, C., Rojemo, N.: New dimensions in heap profiling. Journal of Functional Programming 6(4), 587–620 (1996)

    Article  MATH  Google Scholar 

  24. Shaham, R., Kolodner, E.K., Sagiv, M.: Automatic removal of array memory leaks in java. In: Computational Complexity, pp. 50–66 (2000)

    Google Scholar 

  25. Shaham, R., Kolodner, E.K., Sagiv, M.: Estimating the impact of heap liveness information on space consumption in Java. In: International Symposium on Memory Management (June 2002)

    Google Scholar 

  26. Sitraka Inc. JProbeTMProfiler with Memory Debugger ServerSide Suite

    Google Scholar 

  27. Heap Analysis Tool, http://java.sun.com/people/billf/heap

  28. Java 2 Platform, Enterprise Edition, http://java.sun.com/j2ee

  29. Sun Microsystems HPROF JVM profiler

    Google Scholar 

  30. Wilson, S., Kesselmann, J.: JavaTMPlatform Performance Strategies and Tactics. Addison-Wesley, Reading (2000)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Mitchell, N., Sevitsky, G. (2003). LeakBot: An Automated and Lightweight Tool for Diagnosing Memory Leaks in Large Java Applications. In: Cardelli, L. (eds) ECOOP 2003 – Object-Oriented Programming. ECOOP 2003. Lecture Notes in Computer Science, vol 2743. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-45070-2_16

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-45070-2_16

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-40531-3

  • Online ISBN: 978-3-540-45070-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics