skip to main content
10.1145/1168054.1168070acmotherconferencesArticle/Chapter ViewAbstractPublication PagespppjConference Proceedingsconference-collections
Article

A framework for unified resource management in Java

Published:30 August 2006Publication History

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.

References

  1. Alexandrescu, A., and Marginean, P. Simplify Your Exception-Safe Code -- Forever. C/C++ Users Journal, October 2000.http://www.ddj.com/dept/cpp/184403758 (accessed April 2006).Google ScholarGoogle Scholar
  2. Apache Tomcat Project. http://tomcat.apache.org/ (accessed April 2006).Google ScholarGoogle Scholar
  3. Bloch, J. Effective Java. Addison-Wesley, 2001.Google ScholarGoogle Scholar
  4. Campione, M., Walrath, K., and Huml, A. The Java Tutorial. 2005. http://java.sun.com/docs/books/tutorial/networking/index.html (accessed April 2006).Google ScholarGoogle Scholar
  5. Chen, R. Cleaner, more elegant, and harder to recognize. Jan. 14, 2005. http://blogs.msdn.com/oldnewthing/archive/2005/01/14/352949.aspx (accessed April 2006).Google ScholarGoogle Scholar
  6. Czajkowski, G., Hahn, S., Skinner, G., Soper, P., and Bryce, C. A resource management interface for the Java platform. Software: Practice and Experience, 2005, pp 123--157. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. ECMA. Standard ECAM-334: C# Language Specification, 3rd Ed. December 2002. http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf (accessed April 2006).Google ScholarGoogle Scholar
  8. Gosling, J., Joy, B., Steele G., and Bracha, G. The Java Language Specification, 3rd Ed. Addison-Wesley, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Halloway, S. JDC Tech Tips: January 24, 2000. http://java.sun.com/developer/TechTips/2000/tt0124.html (accessed April 2006).Google ScholarGoogle Scholar
  10. Java Bug: 4484411, stack overflow error closing a socket input stream. 2001. http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4484411 (accessed April 2006).Google ScholarGoogle Scholar
  11. Lanin, V. and Shasha, D. Tree Locking on Changing Trees. Technical Report 503, 1990, New York University. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Park, D. A. Simplifying Resource Management in Java. Technical Report 2006-05. Master's Thesis, University of Mississippi, May 2006.Google ScholarGoogle Scholar
  13. Spolsky, J. How Microsoft Lost the API War. June 13, 2004. http://www.joelonsoftware.com/articles/APIWar.html (accessed April 2006).Google ScholarGoogle Scholar
  14. Spolsky, J. Making Wrong Code Look Wrong. May 11, 2005. http://www.joelonsoftware.com/articles/Wrong.html (accessed April 2006).Google ScholarGoogle Scholar
  15. Stroustrup, B. The C++ Programming Language, 3rd Ed. Addison-Wesley, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Sun Microsystems. Java 2 Platform Standard Edition 5.0 API Specification. 2004. http://java.sun.com/j2se/1.5.0/docs/api/index.html (accessed April 2006).Google ScholarGoogle Scholar
  17. Weimer, W. and Necula, G. Finding and Preventing Run-Time Error Handling Mistakes. Proc. of 19th ACM OOPSLA, pp 419--431, Vancouver, British Columbia, Canada, October 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A framework for unified resource management in Java

    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 Other conferences
      PPPJ '06: Proceedings of the 4th international symposium on Principles and practice of programming in Java
      August 2006
      230 pages
      ISBN:3939352055
      DOI:10.1145/1168054

      Copyright © 2006 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: 30 August 2006

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • Article

      Acceptance Rates

      Overall Acceptance Rate29of58submissions,50%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader