Abstract
Garbage collection has proven benefits, including fewer memory related errors and reduced programmer effort. Garbage collection, however, trades space for time. It reclaims memory only when it is invoked: invoking it more frequently reclaims memory quickly, but incurs a significant cost; invoking it less frequently fills memory with dead objects. In contrast, explicit memory management provides prompt low cost reclamation, but at the expense of programmer effort.This work comes closer to the best of both worlds by adding novel compiler and runtime support for compiler inserted frees to a garbage-collected system. The compiler's free-me analysis identifies when objects become unreachable and inserts calls to free. It combines a lightweight pointer analysis with liveness information that detects when short-lived objects die. Our approach differs from stack and region allocation in two crucial ways. First, it frees objects incrementally exactly when they become unreachable, instead of based on program scope. Second, our system does not require allocation-site lifetime homogeneity, and thus frees objects on some paths and not on others. It also handles common patterns: it can free objects in loops and objects created by factory methods.We evaluate free() variations for free-list and bump-pointer allocators. Explicit freeing improves performance by promptly reclaiming objects and reducing collection load. Compared to marksweep alone, free-me cuts total time by 22% on average, collector time by 50% to 70%, and allows programs to run in 17% less memory. This combination retains the software engineering benefits of garbage collection while increasing space efficiency and improving performance, and thus is especially appealing for real-time and space constrained systems.
- B. Alpern et al. Implementing Jalapeño in Java. In ACM Conference on Object-Oriented Programming Systems, Languages,and Applications, pages 314--324, Denver, CO, Nov. 1999.]] Google Scholar
Digital Library
- B. Alpern et al. The Jalapeño virtual machine. IBM Systems Journal, 39(1):211--238, February 2000.]] Google Scholar
Digital Library
- L. O. Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen, May 1994.]]Google Scholar
- D. F. Bacon, P. Cheng, D. Grove, and M. T. Vechev. Syncopation: Generational real-time garbage collector in the metronome. In ACM Languages, Compilers, and Tools for Embedded Systems, pages 183--192, Chicago, IL, June 2005.]] Google Scholar
Digital Library
- J. M. Barth. Shifting garbage collection overhead to compile time. Communications of the ACM, 20(7):513--518, July 1977.]] Google Scholar
Digital Library
- E. D. Berger, B. G. Zorn, and K. S. McKinley. Reconsidering custom memory allocation. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 1--12, Seattle, WA, Nov. 2002.]] Google Scholar
Digital Library
- S. M. Blackburn, P. Cheng, and K. S. McKinley. Myths and realities: The performance impact of garbage collection. In ACMSIGMETRICS Conference on Measurement & Modeling Computer Systems, pages 25--36, NY, NY, June 2004.]] Google Scholar
Digital Library
- S. M. Blackburn, P. Cheng, and K. S. McKinley. Oil and water? High performance garbage collection in Java with JMTk. In International Conference on Software Engineering, pages 137--146, Scotland, UK, May 2004.]] Google Scholar
Digital Library
- S. M. Blackburn, R. Garner, C. Hoffmann, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, S. Z. Guyer, A. Hosking, M. Jump, J. E. B. Moss, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo Benchmarks: Java benchmarking development and analysis. Technical Report TRCS-06-01, Deptartment of Computer Science, Austrailian National University, Mar. 2006. http://ali-www.cs.umass.edu/DaCapo/-Benchmarks.]]Google Scholar
Digital Library
- B. Blanchet. Escape analysis for Java: Theory and practice. ACM Transactions on Programming Languages and Systems, 25(6):713--775, Nov. 2003.]] Google Scholar
Digital Library
- S. Cherem and R. Rugina. Region analysis and transformation for Java programs. In ACM International Symposium on Memory Management, pages 85--96, Vancouver, BC, 2004.]] Google Scholar
Digital Library
- W. Chin, F. Craciun, S. Qin, and M. Rinard. Region inference for object-oriented language. In ACM Conference on Programming Languages Design and Implementation, pages 243--354, Washington, DC, June 2004.]] Google Scholar
Digital Library
- J. Choi, M. Gupta, M. J. Serrano, V. C. Sreedhar, and S. P. Midkiff. Stack allocation and synchronization optimizations for Java using escape analysis. ACM Transactions on Programming Languages and Systems, 25(6):876--910, Nov. 2003.]] Google Scholar
Digital Library
- C. Click. Stack allocation, Jan. 2005. Personal Communication.]]Google Scholar
- R. Cytron, J. Ferrante, B. Rosen, M. Wegman, and K. Zadeck. Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems, 13(4):451--490, Oct. 1991.]] Google Scholar
Digital Library
- L. Eeckhout, A. Georges, and K. D. Bosschere. How Java programs interact with virtual machines at the microarchitectural level. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 244--358, Anaheim, CA, Oct. 2003.]] Google Scholar
Digital Library
- Y. Feng and E. D. Berger. A locality-improving dynamic memory allocator. In ACM Conference on Memory System Performance, pages 1--12, Chicago, IL, June 2005.]] Google Scholar
Digital Library
- R. P. Fitzgerald, T. B. Knoblock, E. Ruf, B. Steensgaard, and D. Tarditi. Marmot: An optimizing compiler for Java. Software-Practice and Experience, 30(3):199--232, 2000.]] Google Scholar
Digital Library
- D. Gay and A. Aiken. Language support for regions. In ACM Conference on Programming Languages Design and Implementation, pages 70--80, Snowbird, UT, 2001.]] Google Scholar
Digital Library
- D. Gay and B. Steensgaard. Fast escape analysis and stack allocation for object-based programs. In International Conference on Compiler Construction, pages 82--93, Berlin, Germany, 2000.]] Google Scholar
Digital Library
- O. Gheorghioiu, A. Salcianu, and M. Rinard. Interprocedural compatibility analysis for static object preallocation. In ACM Symposium on the Principles of Programming Languages, pages 273--284, New Orleans, LA, Jan. 2003.]] Google Scholar
Digital Library
- N. Hallenberg, M. Elsman, and M. Tofte. Combining region inference and garbage collection. In ACM Conference on Programming Languages Design and Implementation, pages 141--152, Berlin, Germany, June 2002.]] Google Scholar
Digital Library
- M. Hertz and E. Berger. Quantifying the performance of garbage collection vs. explicit memory mananagement. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, San Diego, CA, Oct. 2005.]] Google Scholar
Digital Library
- M. Hicks, G. Morrisett, D. Grossman, and T. Jim. Experience with safe manual memory-management in Cyclone. In ACM International Symposium on Memory Management, pages 73--84, Vancouver, BC, 2004.]] Google Scholar
Digital Library
- M. Hirzel, A. Diwan, and J. Henkel. On the usefulness of type and liveness accuracy for garbage collection and leak detection. ACM Transactions on Programming Languages and Systems, 24(6):593--624, Nov. 2002.]] Google Scholar
Digital Library
- H. Inoue, D. Stefanović, and S. Forrest. Object lifetime prediction in Java. Technical Report TR-CS-2003-28, University of New Mexico, May 2003.]]Google Scholar
- Jikes RVM. IBM, 2005. http://jikesrvm.sourceforge.net.]]Google Scholar
- S. B. Jones and D. Le Métayer. Compile-time garbage collection by sharing analysis. In ACM Inteornational Conference on Functional Programming Languages and Computer Architecture, pages 54--74, Nov. 1989.]] Google Scholar
Digital Library
- D. Lea. A memory allocator. http://gee.cs.oswego.edu/dl/html/malloc.html, 1997.]]Google Scholar
- O. Lee and K. Yi. Experiments on the effectiveness of an automatic insertion of memory reuses into XSML-like programs. In ACM International Symposium on Memory Management, pages 97--108, Vancouver, BC, 2004.]] Google Scholar
Digital Library
- D. Marinov and R. O'Callahan. Object equality profiling. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 313--325, Anahiem, CA, Oct. 2003.]] Google Scholar
Digital Library
- F. Qian and L. Hendren. An adaptive, region-based allocator for Java. In ACM International Symposium on Memory Management, Berlin, Germany, June 2002.]] Google Scholar
Digital Library
- R. Shaham, E. K. Kolodner, and M. Sagiv. Heap profiling for spaceefficient Java. In ACM Conference on Programming Languages Design and Implementation, pages 104--133, Snowbird, UT, 2001.]] Google Scholar
Digital Library
- R. Shaham, E. Yahav, E. K. Kolodner, and M. Sagiv. Establishing local temporal heap safety properties with application to compiletime memory management. In Static Analysis Symposium, pages 483--503, San Diego, CA, June 2003.]]Google Scholar
Cross Ref
- Standard Performance Evaluation Corporation. SPECjvm98 Documentation, release 1.03 edition, March 1999.]]Google Scholar
- Standard Performance Evaluation Corporation. SPECjbb2000 (Java Business Benchmark) Documentation, release 1.01 edition, 2001.]]Google Scholar
- M. Tofte and J. Talpin. Region-based memory management. Information and Computation, 1997.]] Google Scholar
Digital Library
- D. M. Ungar. Generation scavenging: A non-disruptive high performance storage reclamation algorithm. In ACM Software Engineering Symposium on Practical Software Development Environments, pages 157--167, April 1984.]] Google Scholar
Digital Library
- J. Whaley and M. Rinard. Compositional pointer and escape analysis for Java programs. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 187--206, Nov. 1999.]] Google Scholar
Digital Library
Index Terms
Free-Me: a static analysis for automatic individual object reclamation
Recommendations
Free-Me: a static analysis for automatic individual object reclamation
PLDI '06: Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and ImplementationGarbage collection has proven benefits, including fewer memory related errors and reduced programmer effort. Garbage collection, however, trades space for time. It reclaims memory only when it is invoked: invoking it more frequently reclaims memory ...
The garbage collection advantage: improving program locality
OOPSLA '04: Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applicationsAs improvements in processor speed continue to outpace improvements in cache and memory speed, poor locality increasingly degrades performance. Because copying garbage collectors move objects, they have an opportunity to improve locality. However, no ...
The garbage collection advantage: improving program locality
OOPSLA '04As improvements in processor speed continue to outpace improvements in cache and memory speed, poor locality increasingly degrades performance. Because copying garbage collectors move objects, they have an opportunity to improve locality. However, no ...







Comments