A framework for unified resource management in Java

  • Authors:
  • Derek A. Park;Stephen V. Rice

  • Affiliations:
  • The University of Mississippi, Oxford, MS;The University of Mississippi, University, MS

  • Venue:
  • PPPJ '06 Proceedings of the 4th international symposium on Principles and practice of programming in Java
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Although Java automates the deallocation of memory through garbage collection, a Java program must explicitly free other resources, such as sockets and database connections, to prevent resource leaks. Correct and complete resource deallocation may be complex, requiring nested try-catch-finally blocks. The Framework for Unified Resource Management (Furm) is a Java library designed with the goal of simplifying resource management in single- and multi-threaded programs. Allocated resources are represented by bodes in "resource trees" and resource dependencies are modeled as parent-child relationships. A hierarchy of resources is easily and correctly deallocated by a single call of Furm's release method. Resource trees permit "resource reflection" in which a program monitors its own resource usage. A special WatchDog object detects when a thread dies and takes care of releasing its resources. Furm reduces code complexity while guaranteeing resource cleanup in the face of exceptions and thread termination.