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
- 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 Scholar
Digital Library
- 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 Scholar
- BEA. JRockit Mission Control. http://dev2dev.bea.com/jrockit/tools.html.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- D. G. Clarke, J. M. Potter, and J. Noble. Ownership types for flexible alias protection. SIGPLAN Notices, 33(10):48--64, 1998. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- S. D. N. Forum. Java programming {archive} -- garbage collection dilema (sic). http://forums.sun.com/thread.jspa?threadID=446934.Google Scholar
- A. S. Foundation. Apache http server project. http://httpd.apache.org/.Google Scholar
- A. S. Foundation. Apache lucene -- overview. http://lucene.apache.org/java/docs/index.html.Google Scholar
- A. S. Foundation. Apache portable runtime project. http://apr.apache.org/.Google Scholar
- 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 Scholar
- J. Fox. When is a singleton not a singleton? http://java.sun.com/developer/technicalArticles/Programming/singletons/.Google Scholar
- P. Fradet and D. L. Métayer. Shape types. In ACM Symposium on the Principles of Programming Languages, pages 27--39, 1997. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- M. Jump and K. S. McKinley. Dynamic shape analysis. In ACM International Symposium on Memory Management, 2009. Google Scholar
Digital Library
- Jvm tool interface. http://java.sun.com/javase/6/docs/platform/jvmti/jvmti.html.Google Scholar
- 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 Scholar
Digital Library
- S. McPeak and G. Necula. Data structure specifications via local equality axioms. In Computer Aided Verification, pages 476--490, 2005. Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
- 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 Scholar
Digital Library
- Quest. JProbe Memory Debugger. http://www.quest.com/jprobe/debugger.asp.Google Scholar
- 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 Scholar
Digital Library
- SciTech Software. .NET Memory Profiler. http://www.scitech.se/memprofiler/.Google Scholar
- 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 Scholar
Digital Library
- Standard Performance Evaluation Corporation. SPECjvm98 Documentation, release 1.03 edition, 1999.Google Scholar
- Standard Performance Evaluation Corporation. SPECjbb2000 Documentation, release 1.01 edition, 2001.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
GC assertions: using the garbage collector to check heap properties






Comments