skip to main content
10.1145/1296907.1296923acmconferencesArticle/Chapter ViewAbstractPublication PagesismmConference Proceedingsconference-collections
Article

Uniqueness inference for compile-time object deallocation

Published:21 October 2007Publication History

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. J. Boyland. Alias burying: Unique variables without destructive reads. Software Practice and Experience, 31(6):533--553, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. GNU Classpath. http://www.gnu.org/software/classpath/.Google ScholarGoogle Scholar
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. N. Minsky. Towards alias--free pointers. In Proceedings of the European Conference on Object--Oriented Programming, July 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle ScholarCross RefCross Ref
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. 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 ScholarGoogle Scholar
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. R. Wilhelm, M. Sagiv, and T. Reps. Shape analysis. In Proceedings of the International Conference on Compiler Construction, Berlin, Germany, April 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Uniqueness inference for compile-time object deallocation

        Recommendations

        Comments

        Login options

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

        Sign in
        • Published in

          cover image ACM Conferences
          ISMM '07: Proceedings of the 6th international symposium on Memory management
          October 2007
          192 pages
          ISBN:9781595938930
          DOI:10.1145/1296907

          Copyright © 2007 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 21 October 2007

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • Article

          Acceptance Rates

          Overall Acceptance Rate72of156submissions,46%

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader