10.1145/1542476.1542503acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

GC assertions: using the garbage collector to check heap properties

Published:15 June 2009Publication History

ABSTRACT

This paper introduces GC assertions, a system interface that programmers can use to check for errors, such as data structure invariant violations, and to diagnose performance problems, such as memory leaks. GC assertions are checked by the garbage collector, which is in a unique position to gather information and answer questions about the lifetime and connectivity of objects in the heap. By piggybacking on existing garbage collector computations, our system is able to check heap properties with very low overhead -- around 3% of total execution time -- low enough for use in a deployed setting.

We introduce several kinds of GC assertions and describe how they are implemented in the collector. We also describe our reporting mechanism, which provides a complete path through the heap to the offending objects. We report results on both the performance of our system and the experience of using our assertions to find and repair errors in real-world programs.

References

  1. M. Arnold, M. Vechev, and E. Yahav. Qvm: an efficient runtime for detecting defects in deployed systems. In OOPSLA '08: Proceedings of the 23rd ACM SIGPLAN conference on Object oriented programming systems languages and applications, pages 143--162, New York, NY, USA, 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. M. Barnett, K. Rustan, M. Leino, and W. Schulte. The spec# programming system: An overview. http://research.microsoft.com/users/leino/papers/krml136.pdf.Google ScholarGoogle Scholar
  3. BEA. JRockit Mission Control. http://dev2dev.bea.com/jrockit/tools.html.Google ScholarGoogle Scholar
  4. E. D. Berger, B. G. Zorn, and K. S. McKinley. Reconsidering custom memory allocation. In Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 1--12, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. Berndl, O. Lhoták, F. Qian, L. Hendren, and N. Umanee. Points-to analysis using bdds. In ACM Conference on Programming Languages Design and Implementation, pages 103--114, New York, NY, USA, 2003. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. S. M. e. a. Blackburn. The DaCapo Benchmarks: Java Benchmarking Development and Analysis. In Conference on Object-Oriented Programming, Systems, Languages, and Applications, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. M. D. Bond and K. S. McKinley. Bell: Bit-Encoding Online Memory Leak Detection. In International Conference on Architectural Support for Programming Languages and Operating Systems, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. D. Bond and K. S. McKinley. Tolerating memory leaks. In OOPSLA'08: Proceedings of the 23rd ACM SIGPLAN conference on Object oriented programming systems languages and applications, pages 109--126, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. C. Boyapati, B. Liskov, and L. Shrira. Ownership types for object encapsulation. In ACM Symposium on the Principles of Programming Languages, pages 213--223, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. N. R. Cameron, S. Drossopoulou, J. Noble, and M. J. Smith. Multiple ownership. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 441--460, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. D. R. Chase, M. Wegman, and F. K. Zadeck. Analysis of pointers and structures. In ACM Conference on Programming Languages Design and Implementation, pages 296--310, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Y. Cheon and G. T. Leavens. A runtime assertion checker for the java modeling language (jml). Technical Report TR 03-09, Iowa State University, 2003.Google ScholarGoogle Scholar
  13. T. M. Chilimbi and V. Ganapathy. HeapMD: Identifying Heap-based Bugs using Anomaly Detection. In International Conference on Architectural Support for Programming Languages and Operating Systems, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. T. M. Chilimbi and M. Hauswirth. Low-Overhead Memory Leak Detection Using Adaptive Statistical Profiling. In Conference on Architectural Support for Programming Languages and Operating Systems, pages 156--164, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. D. G. Clarke, J. M. Potter, and J. Noble. Ownership types for flexible alias protection. SIGPLAN Notices, 33(10):48--64, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. P. T. Darga and C. Boyapati. Efficient software model checking of data structure properties. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 363--382, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. D. N. Forum. Java programming {archive} -- garbage collection dilema (sic). http://forums.sun.com/thread.jspa?threadID=446934.Google ScholarGoogle Scholar
  18. A. S. Foundation. Apache http server project. http://httpd.apache.org/.Google ScholarGoogle Scholar
  19. A. S. Foundation. Apache lucene -- overview. http://lucene.apache.org/java/docs/index.html.Google ScholarGoogle Scholar
  20. A. S. Foundation. Apache portable runtime project. http://apr.apache.org/.Google ScholarGoogle Scholar
  21. A. S. Foundation. Indexsearcher (lucene 1.9.1 api). http://lucene.apache.org/java/1\_9\_1/api/org/apache/lucene/search/IndexSearcher.html.Google ScholarGoogle Scholar
  22. J. Fox. When is a singleton not a singleton? http://java.sun.com/developer/technicalArticles/Programming/singletons/.Google ScholarGoogle Scholar
  23. P. Fradet and D. L. Métayer. Shape types. In ACM Symposium on the Principles of Programming Languages, pages 27--39, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. R. Ghiya and L. J. Hendren. Is it a tree, a DAG, or a cyclic graph? A shape analysis for heap-directed pointers in C. In ACM Symposium on the Principles of Programming Languages, pages 1--15, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. M. Gorbovitski, T. Rothamel, Y. A. Liu, and S. D. Stoller. Efficient runtime invariant checking: a framework and case study. In WODA'08: Proceedings of the 2008 international workshop on dynamic analysis, pages 43--49, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. B. Hackett and R. Rugina. Region-based shape analysis with tracked locations. In ACM Symposium on the Principles of Programming Languages, pages 310--323, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. M. Jump and K. S. McKinley. Cork: dynamic memory leak detection for garbage-collected languages. In Symposium on Principles of Programming Languages, pages 31--38, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. M. Jump and K. S. McKinley. Dynamic shape analysis. In ACM International Symposium on Memory Management, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Jvm tool interface. http://java.sun.com/javase/6/docs/platform/jvmti/jvmti.html.Google ScholarGoogle Scholar
  30. W. Landi, B. G. Ryder, and S. Zhang. Interprocedural modification side effect analysis with pointer aliasing. In ACM Conference on Programming Languages Design and Implementation, pages 56--67, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. S. McPeak and G. Necula. Data structure specifications via local equality axioms. In Computer Aided Verification, pages 476--490, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. N. Mitchell and G. Sevitsky. LeakBot: An Automated and Lightweight Tool for Diagnosing Memory Leaks in Large Java Applications. In European Conference on Object-Oriented Programming, pages 351--377, 2003.Google ScholarGoogle Scholar
  33. G. Novark, T. Strohman, and E. D. Berger. Custom object layout for garbage-collected languages. Technical Report UM-CS-2006-06, UMass Amherst, 2006.Google ScholarGoogle Scholar
  34. M. E. O'Neill and F. W. Burton. Smarter garbage collection with simplifiers. In Workshop on Memory System Performance and Correctness, pages 19--30, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Quest. JProbe Memory Debugger. http://www.quest.com/jprobe/debugger.asp.Google ScholarGoogle Scholar
  36. M. Sagiv, T. Reps, and R. Wilhelm. Parametric shape analysis via 3-valued logic. In ACM Symposium on the Principles of Programming Languages, pages 105--118, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. SciTech Software. .NET Memory Profiler. http://www.scitech.se/memprofiler/.Google ScholarGoogle Scholar
  38. A. Shankar and R. Bodík. Ditto: automatic incrementalization of data structure invariant checks (in java). In PLDI'07: Proceedings of the 2007 ACM SIGPLAN conference on Programming language design and implementation, pages 310--319, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Standard Performance Evaluation Corporation. SPECjvm98 Documentation, release 1.03 edition, 1999.Google ScholarGoogle Scholar
  40. Standard Performance Evaluation Corporation. SPECjbb2000 Documentation, release 1.01 edition, 2001.Google ScholarGoogle Scholar
  41. X. Wang, Z. Xu, X. Liu, Z. Guo, X. Wang, and Z. Zhang. Conditional correlation analysis for safe region-based memory management. In PLDI '08: Proceedings of the 2008 ACM SIGPLAN conference on Programming language design and implementation, pages 45--55, New York, NY, USA, 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. K. Zee, V. Kuncak, and M. Rinard. Full functional verification of linked data structures. In ACM Conference on Programming Languages Design and Implementation, pages 349--361, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. GC assertions: using the garbage collector to check heap properties

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!