ABSTRACT
This paper presents an analysis and transformation for individual object reclamation in Java programs. First, we propose a uniqueness inference algorithm that identifies variables and object fields that hold unique references. The algorithm performs an intra-procedural analysis of each method, and then builds and solves a set of inter-procedural uniqueness dependencies to find the global solution. Second, our system uses the uniqueness information to automatically instrument programs with explicit deallocation of individual objects. A key feature of the transformation is its ability to deallocate entire heap structures, including recursive structures, when their root objects are freed. This is achieved by generating object destructors that recursively free all of the unique object fields. Our experiments show that the analysis is effective at reclaiming a large fraction of the objects at a low analysis cost.
- J. Aldrich, V. Kostadinov, and C. Chambers. Alias annotations for program understanding. In Proceedings of the Conference on Object--Oriented Programming Systems, Languages and Applications, Seattle, WA, November 2002. Google ScholarDigital Library
- B. Alpern, D. Attanasio, A. Cochi, D. Lieber, S. Smith, T. Ngo, and J. Barton. Implementing Jalapeno in Java. In Proceedings of the Conference on Object--Oriented Programming Systems, Languages and Applications, Denver, CO, November 1999. Google ScholarDigital Library
- J. Boyland. Alias burying: Unique variables without destructive reads. Software Practice and Experience, 31(6):533--553, 2001. Google ScholarDigital Library
- S. Cherem and R. Rugina. Region analysis and transformation for Java programs. In Proceedings of the International Symposium on Memory Management, Vancouver, Canada, October 2004. Google ScholarDigital Library
- S. Cherem and R. Rugina. Compile--time deallocation of individual objects. In Proceedings of the International Symposium on Memory Management, Ottawa, Canada, June 2006. Google ScholarDigital Library
- S. Cherem and R. Rugina. A practical escape and effect analysis for building lightweight method summaries. In Proceedings of the International Conference on Compiler Construction, Braga, Portugal, March 2007. Google ScholarDigital Library
- W. Chin, F. Craciun, S. Qin, and M. Rinard. Region inference for an object--oriented language. In Proceedings of the ACM Conference on Program Language Design and Implementation, Washington, DC, June 2004. Google ScholarDigital Library
- GNU Classpath. http://www.gnu.org/software/classpath/.Google Scholar
- D. Gay and B. Steensgaard. Fast escape analysis and stack allocation for object--based programs. In Proceedings of the International Conference on Compiler Construction, Berlin, Germany, April 2000. Google ScholarDigital Library
- S. Guyer, K. McKinley, and D. Frampton. Free--me: A static analysis for automatic individual object reclamation. In Proceedings of the ACM Conference on Program Language Design and Implementation, Ottawa, Canada, June 2006. Google ScholarDigital Library
- B. Hackett and R. Rugina. Region--based shape analysis with tracked locations. In Proceedings of the ACM Symposium on the Principles of Programming Languages, Long Beach, CA, January 2005. Google ScholarDigital Library
- M. Hicks, G. Morrisett, D. Grossman, and T. Jim. Experience with safe manual memory--management in Cyclone. In Proceedings of the International Symposium on Memory Management, Vancouver, Canada, October 2004. Google ScholarDigital Library
- K. Ma and J. Foster. Inferring aliasing and encapsulation properties for Java. In Proceedings of the Conference on Object--Oriented Programming Systems, Languages and Applications, Montreal, Canada, October 2007. Google ScholarDigital Library
- N. Minsky. Towards alias--free pointers. In Proceedings of the European Conference on Object--Oriented Programming, July 1996. Google ScholarDigital Library
- M. Sagiv, T. Reps, and R. Wilhelm. Solving shape--analysis problems in languages with destructive updating. ACM Transactions on Programming Languages and Systems, 20(1):1--50, January 1998. Google ScholarDigital Library
- M. Sagiv, T. Reps, and R. Wilhelm. Parametric shape analysis via 3--valued logic. ACM Transactions on Programming Languages and Systems, 24(3), May 2002. Google ScholarDigital Library
- R. Shaham, E. Yahav, E. K. Kolodner, and M. Sagiv. Establishing local temporal heap safety properties with applications to compiletime memory management. In Proceedings of the International Static Analysis Symposium, San Diego, CA, June 2003.Google ScholarCross Ref
- M. Tofte and J.--P. Talpin. Implementation of the typed call--by--value lambda--calculus using a stack of regions. In Proceedings of the ACM Symposium on the Principles of Programming Languages, Portland, OR, January 1994. Google ScholarDigital Library
- R. Vallee--Rai, L. Hendren, V. Sundaresan, P. Lam, E. Gagnon, and P. Co. Soot -- a Java optimization framework. In CASCON '99, Toronto, Canada, November 1999. Google ScholarDigital Library
- P. Wadler. Linear types can change the world! In M. Broy and C. Jones, editors, Working Conference on Programming Concepts and Methods, pages 347--359. North Holland, 1990.Google Scholar
- J. Whaley and M. Rinard. Compositional pointer and escape analysis for Java programs. In Proceedings of the Conference on Object--Oriented Programming Systems, Languages and Applications, Denver, CO, November 1999. Google ScholarDigital Library
- R. Wilhelm, M. Sagiv, and T. Reps. Shape analysis. In Proceedings of the International Conference on Compiler Construction, Berlin, Germany, April 2000. Google ScholarDigital Library
Index Terms
- Uniqueness inference for compile-time object deallocation
Recommendations
Compile-time deallocation of individual objects
ISMM '06: Proceedings of the 5th international symposium on Memory managementThis paper presents a static analysis and transformation system that enables the deallocation of individual objects in Java programs. Given an input program, the compiler automatically inserts free statements to deallocate individual objects. This ...
Inferring aliasing and encapsulation properties for java
Proceedings of the 2007 OOPSLA conferenceThere are many proposals for language techniques to control aliasing and encapsulation in object oriented programs, typically based on notions of object ownership and pointer uniqueness. Most of these systems require extensive manual annotations, and ...
Inferring aliasing and encapsulation properties for java
OOPSLA '07: Proceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems, languages and applicationsThere are many proposals for language techniques to control aliasing and encapsulation in object oriented programs, typically based on notions of object ownership and pointer uniqueness. Most of these systems require extensive manual annotations, and ...
Comments