On the Usefulness of Liveness for Garbage Collection and Leak Detection

  • Martin Hirzel
  • Amer Diwan
  • Antony Hosking
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2072)

Abstract

The effectiveness of garbage collectors and leak detectors in identifying dead objects depends on the “accuracy” of their reachability traversal. Accuracy has two orthogonal dimensions: (i) whether the reachability traversal can distinguish between pointers and non-pointers (type accuracy), and (ii) whether the reachability traversal can identify memory locations that will be dereferenced in the future (liveness accuracy). While prior work has investigated the importance of type accuracy, there has been little work investigating the importance of liveness accuracy for garbage collection or leak detection. This paper presents an experimental study of the importance of liveness on the accuracy of the reachability traversal. We show that while liveness can significantly improve the effectiveness of a garbage collector or leak detector, the simpler liveness schemes are largely ineffective. One must analyze globals using an interprocedural analysis to get significant benefit.0

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [1]
    Ole Agesen, David Detlefs, and J. Eliot B. Moss. Garbage collection and local variable type-precision and liveness in Java virtual machines. In ACM conference on programming language design and implementation, pages 269–279, Montreal, Canada, June 1998.Google Scholar
  2. [2]
    Bowen Alpern et al. The Jalapeño virtual machine. IBM Systems Journal, 39(1):211–238, February 2000.CrossRefGoogle Scholar
  3. [3]
    Andrew W. Appel. A Runtime System. Lisp and Symbolic Computation, 3(4):343–380, November 1990.CrossRefGoogle Scholar
  4. [4]
    Joel F. Bartlett. Compacting garbage collection with ambiguous roots. Technical Report 88/2, DEC Western Research Laboratory, Palo Alto, CA, February 1988. Also in Lisp Pointers 1(6):2–12, April-June 1988.Google Scholar
  5. [5]
    Joel F. Bartlett. Mostly-copying garbage collection picks up generations and C++. Technical report, DEC Western Research Laboratory, Palo Alto, CA, October 1989.Google Scholar
  6. [6]
    Hans Boehm, Alan Demers, and Scott Shenker. Mostly parallel garbage collection. In ACM conference on programming language design and implementation, pages 157–164, Minneapolis, MN, November 1991.Google Scholar
  7. [7]
    Hans Boehm, Alan Demers, and Mark Weiser. A garbage collector for C and C++. http://www.hpl.hp.com/personal/Hans_Boehm/gc/.
  8. [8]
    Hans Boehm and Zhong Shao. Inferring type maps during garbage collection. In OOPSLA’ 93 Workshop on Memory Management and Garbage Collection, September 1993.Google Scholar
  9. [9]
    Hans Boehm and Mark Weiser. Garbage collection in an uncooperative environment. Software—Practice and experience, pages 807–820, September 1988.Google Scholar
  10. [10]
    Dominique Colnet, Philippe Coucaud, and Olivier Zendra. Compiler support to customize the mark and sweep algorithm. In Proceedings of the International Symposium on Memory Management, pages 154–165, Vancouver, October 1998.Google Scholar
  11. [11]
    Jeremy Dion and Louis Monier. Third degree. http://research.compaq.com/wrl/projects/om/third.html.
  12. [12]
    Amer Diwan, J. Eliot B. Moss, and Richard L. Hudson. Compiler support for garbage collection in a statically typed language. In ACM conference on programming language design and implementation, pages 273–282, San Francisco, CA, July 1992.Google Scholar
  13. [13]
    Great Circle-Real-time error detection and code diagnosis for developers. http://www.geodesic.com/products/greatcircle.html.
  14. [14]
    James Gosling, Bill Joy, and Guy Steele. The Java language specification. Addison-Wesley, 1996.Google Scholar
  15. [15]
    Reed Hastings and Bob Joyce. Fast detection of memory leaks and access errors. In Proceedings of the Winter’ 92 USENIX conference, pages 125–136, 1992.Google Scholar
  16. [16]
    Michael Hicks, Jonathan Moore, and Scott Nettles. The measured cost of copying garbage collection mechanisms. In Functional Programming, pages 292–305, June 1997.Google Scholar
  17. [17]
    Martin Hirzel and Amer Diwan. On the type accuracy of garbage collection. In Proceedings of the International Symposium on Memory Management, pages 1–12, Minneapolis, MN, October 2000.Google Scholar
  18. [18]
    Richard L. Hudson, J. Eliot B. Moss, Amer Diwan, and Christopher F. Weight. A language-independent garbage collector toolkit. Technical Report 91-47, University of Massachusetts at Amherst, September 1991.Google Scholar
  19. [19]
    Richard Jones and Rafael Lins. Garbage collection: algorithms for automatic dynamic memory management. John Wiley & Sons, 1st edition, 1997.Google Scholar
  20. [20]
    Robin Milner, Mads Tofte, and Robert Harper. The Definition of Standard ML. MIT Press, Cambridge, Massachusetts, 1990.Google Scholar
  21. [21]
    Greg Nelson, editor. Systems Programming with Modula-3. Prentice Hall, New Jersey, 1991.Google Scholar
  22. [22]
    Todd Proebsting, Gregg Townsend, Patrick Bridges, John Hartman, Tim Newsham, and Scott Watterson. Toba: Java for applications-a way ahead of time (WAT) compiler. In USENIX COOTS, pages 41–53, June 1997.Google Scholar
  23. [23]
    Ran Shaham, Elliot K. Kolodner, and Mooly Sagiv. On the effectiveness of GC in Java. In Proceedings of the International Symposium on Memory Management, pages 12–17, Minneapolis, MN, October 2000.Google Scholar
  24. [24]
    Frederick Smith and Greg Morrisett. Comparing mostly-copying and mark-sweep conservative collection. In Proceedings of the International Symposium on Memory Management, pages 68–78, October 1998.Google Scholar
  25. [25]
    James Stichnoth, Guei-Yuan Lueh, and Michaeł Cierniak. Support for garbage collection at every instruction in a Java compiler. In ACM conference on programming language design and implementation, pages 118–127, May 1999.Google Scholar
  26. [26]
    Stanford University SUIF Research Group. Suif compiler system version 1.x. http://suif.stanford.edu/suif/suif1/index.html.
  27. [27]
    David Tarditi, Greg Morrisett, P. Cheng, C. Stone, Robert Harper, and Peter Lee. TIL: A type-directed optimizing compiler for ML. In ACM conference on programming language design and implementation, pages 181–192, May 1996.Google Scholar
  28. [28]
    David Ungar. Generation scavenging: A non-disruptive high performance storage reclamation algorithm. In Proceedings of the ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments, pages 157–167, 1984.Google Scholar
  29. [29]
    Paul R. Wilson, Michael S. Lam, and Thomas G. Moher. Caching considerations for generational garbage collection. In 1992 ACMConference on Lisp and Functional Programming, pages 32–42, San Francisco, California, June 1992.Google Scholar
  30. [30]
    Robert P. Wilson, Robert S. French, Christopher S. Wilson, Saman P. Amarasinghe, Jennifer-Ann M. Anderson, Steven W. K. Tjiang, Shih-Wei Liao, Chau-Wen Tseng, Mary W. Hall, Monica S. Lam, and John L. Hennessy. SUIF: An infrastructure for research on parallelizing and optimizing compilers. ACM SIGPLAN Notices, 29(12):31–37, December 1984.CrossRefGoogle Scholar
  31. [31]
    Benjamin Zorn. The effect of garbage collection on cache performance. Technical Report CU-CS-528-91, University of Colorado at Boulder, May 1991.Google Scholar
  32. [32]
    Benjamin Zorn. The measured cost of conservative garbage collection. In Software-Practice and Experience, pages 733–756, July 1993.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • Martin Hirzel
    • 1
  • Amer Diwan
    • 1
  • Antony Hosking
    • 2
  1. 1.Purdue University West LafayetteLafayette
  2. 2.University of Colorado Boulder

Personalised recommendations