skip to main content
article

A calculus for java's reference objects

Published:01 August 2007Publication History
Skip Abstract Section

Abstract

Java's Reference objects provide the programmer with limited control over the process of memory management. Although reference objects are often helpful, they introduce nondeterminism into program evaluation and lead to ambiguous program outcome. In this paper we present a calculus to formally reason about Java's Reference objects. We model multiple levels of reference objects in a single calculus and apply a different garbage collection policy to each one of them. Accordingly, weak references are given the semantics of eager collection and soft references are given the semantics of lazy collection. In addition, we constrain garbage collection with the scarcity of two resources: time and space. We demonstrate the viability of our calculus by modeling a Java program which addresses a commonly-encountered caching problem. Using our model, we reason about the program's evaluation and interaction with the garbage collector.

References

  1. "Java TM 2 platform, standard edition, v 1.4.2 API specification." {Online}. Available: http://java.sun.com/j2se/1.4.2/docs/api/Google ScholarGoogle Scholar
  2. Archives of [email protected]., Nov. 2003. {Online}. Available: http://discuss.develop.com/archives/wa.exe?A2=ind0311&L=ADVANCED-JAVA&D=0&I=-3&P=4459Google ScholarGoogle Scholar
  3. K. Donnelly, J. J. Hallett, and A. Kfoury, "Formal semantics of weak references," in ISMM '06: Proceedings of the 2006 international symposium on Memory management. New York, NY, USA: ACM Press, 2006, pp. 126--137. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. M. Felleisen and R. Hieb, "A revised report on the syntactic theories of sequential control and state," Theoretical Computer Science, vol. 103, no. 2, pp. 235--271, 1992. {Online}. Available: citeseer.ist.psu.edu/felleisen92revised.html Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Y. Gabay and A. Kfoury, "Towards formalizing java's weak references," Boston University, CS Dept, MA, Tech. Rep. BUCS-TR-2006-031, Dec. 2006.Google ScholarGoogle Scholar
  6. A. Igarashi, B. Pierce, and P. Wadler, "Featherweight Java: A minimal core calculus for Java and GJ," in Proceedings of the 1999 ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages & Applications (OOPSLA'99), L. Meissner, Ed., vol. 34(10), N. Y., 1999, pp. 132--146. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. G. Morrisett, M. Felleisen, and R. Harper, "Abstract models of memory management," in FPCA '95: Proceedings of the seventh international conference on Functional programming languages and computer architecture. New York, NY, USA: ACM Press, 1995, pp. 66--77. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. E. Nicholas. (2006, May) Understanding weak references. Java.net Article. {Online}. Available: http://weblogs.java.net/blog/enicholas/archive/2006/05/understanding_w_1.htmlGoogle ScholarGoogle Scholar
  9. M. Pawlan. (1998, Aug.) Reference objects and garbage collection. Sun Developer Network Article. {Online}. Available: http://java.sun.com/developer/technicalArticles/ALT/RefObj/Google ScholarGoogle Scholar

Index Terms

  1. A calculus for java's reference objects

          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

          Full Access

          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!