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.
- "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 Scholar
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- M. Pawlan. (1998, Aug.) Reference objects and garbage collection. Sun Developer Network Article. {Online}. Available: http://java.sun.com/developer/technicalArticles/ALT/RefObj/Google Scholar
Index Terms
A calculus for java's reference objects
Recommendations
A generational on-the-fly garbage collector for Java
PLDI '00: Proceedings of the ACM SIGPLAN 2000 conference on Programming language design and implementationAn on-the-fly garbage collector does not stop the program threads to perform the collection. Instead, the collector executes in a separate thread (or process) in parallel to the program. On-the-fly collectors are useful for multi-threaded applications ...
A generational on-the-fly garbage collector for Java
An on-the-fly garbage collector does not stop the program threads to perform the collection. Instead, the collector executes in a separate thread (or process) in parallel to the program. On-the-fly collectors are useful for multi-threaded applications ...
Formal semantics of weak references
ISMM '06: Proceedings of the 5th international symposium on Memory managementWeak references are references that do not prevent the object they point to from being garbage collected. Many realistic languages, including Java, SML/NJ, and Haskell to name a few, support weak references. However, there is no generally accepted ...






Comments