A calculus for java's reference objects

  • Authors:
  • Yarom Gabay;Assaf J. Kfoury

  • Affiliations:
  • Boston University, Boston, MA;Boston University, Boston, MA

  • Venue:
  • ACM SIGPLAN Notices
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

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.