skip to main content
article

Automated discovery of scoped memory regions for real-time Java

Published:20 June 2002Publication History
Skip Abstract Section

Abstract

Advances in operating systems and languages have brought the ideal of reasonably-bounded execution time closer to developers who need such assurances for real-time and embedded systems applications. Recently, extensions to the Java libraries and virtual machine have been proposed in an emerging standard, which provides for specification of release times, execution costs, and deadlines for a restricted class of threads. To use such features, the code executing in the thread must never reference storage that could be subject to garbage collection. The new standard provides for region-like, stack-allocated areas (scopes) of storage that are ignored by garbage collection and deallocated en masse. It now falls to the developer to adapt ordinary Java code to use the real-time Java scoped memory regions.Unfortunately, it is difficult to determine manually how to map object instantiations to scopes. Moreover, if ordinary Java code is modified to effect instantiations in scopes, the resulting code is difficult to read, maintain, and reuse. Static analysis can yield scopes that are correct across all program executions, but such analysis is necessarily conservative in nature. If too many objects appear to live forever under such analysis, then developers cannot rely on static analysis alone to form reasonable scopes.In this paper we present an approach for automatically determining appropriate storage scopes for Java objects, based on dynamic analysis---observed object lifetimes and object referencing behavior. While such analysis is perhaps unsafe across all program executions, our analysis can be coupled with static analysis to bracket object lifetimes, with the truth lying somewhere in between. We provide experimental results that show the memory regions discovered by our technique.

References

  1. Ken Arnold, James Gosling, and David Holmes. The Java Programming Language. Addison-Wesley, Boston, 2000 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. The AspectJ Organization. The AspectJ Programming Guide: Implementation Limitations. http://www.aspectj.org/doc/dist/progguide/apc.html, 2001Google ScholarGoogle Scholar
  3. William S. Beebee, Jr. and Martin Rinard. An implementation of scoped memory for real-time java. In EMSOFT, pages 289--305, 2001 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. B. Blanchet. Escape analysis for object-oriented languages. ACM SIG-PLAN Notices, 34(10):20--34, 1999 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Bollella, Gosling, Brosgol, Dibble, Furr, Hardin, and Turnbull. The Real-Time Specification for Java. Addison-Wesley, 2000 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Dante J. Cannarozzi, Michael P. Plezbert, and Ron K. Cytron. Contaminated garbage collection. Proceedings of the ACM SIGPLAN '00 conference on Programming language design and implementation, pages 264--273, 2000 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Perry Cheng and Guy Belloch. A parallel, real-time garbage collector. ACM SIG-PLAN Notices, 36(5):125--136, May 2001 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. J. Choi, M. Gupta, M. Serrano, V. Sreedhar, and S. Midkiff. Escape analysis for java. ACM SIG-PLAN Notices, 34(10):1--19, 1999 Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. SPEC Corporation. Java SPEC benchmarks. Technical report, SPEC, 1999. Available by purchase from SPECGoogle ScholarGoogle Scholar
  10. Morgan Deters and Ron K. Cytron. Introduction of program instrumentation using aspects. In Proceedings of the OOPSLA 2001 Workshop on Advanced Separation of Concerns in Object-Oriented Systems, Tampa Bay, FL, October 2001. ACM. http://www.cs.ubc.ca/~kdvolder/Workshops/OOPSLA2001/ASoC.htmlGoogle ScholarGoogle Scholar
  11. Morgan Deters, Nicholas Leidenfrost, and Ron K. Cytron. Translation of Java to Real-Time Java using aspects. In Proceedings of the International Workshop on Aspect-Oriented Programming and Separation of Concerns, pages 25--30, Lancaster, United Kingdom, August 2001. Proceedings published as Tech. Rep. CSEG/03/01 by the Computing Department, Lancaster UniversityGoogle ScholarGoogle Scholar
  12. Amer Diwan, Kathryn S. McKinley, and J. Eliot B. Moss. Type-based alias analysis. ACM SIG-PLAN Notices, 33(5):106--117, 1998 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. David Gay and Alex Aiken. Language support for regions. In Proceedings of ACM SIGPLAN '01 Conference on Programming Language Design and Implementation (PLDI), pages 70--80, Snowbird, Utah, May 2001. ACM Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Niels Hallenberg, Martin Elsman, and Mads Tofte. Combining region inference and garbage collection. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'02). ACM Press, June 2002. Berlin, Germany Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Michael Hind, Michael Burke, Paul Carini, and Jong-Deok Choi. Interprocedural pointer alias analysis. ACM Transactions on Programming Languages and Systems, 21(4):848--894, 1999 Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Gregor Kiczales, John Lamping, Anurag Mendhekar, Chris Maeda, Cristina Videira Lopes, Jean-Marc Loingtier, and John Irwin. Aspect-Oriented Programming. In Proceedings of the 11th European Conference on Object-Oriented Programming, June 1997Google ScholarGoogle Scholar
  17. William Landi and Barbara G. Ryder. A safe approximate algorithm for interprocedural pointer aliasing. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI), pages 235--248, New York, NY, 1992. ACM Press Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. C.L. Liu and J.W. Layland. Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Environment. JACM, 20(1):46--61, January 1973 Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Robin Milner, Mads Tofte, Robert Harper, and David McQueen. The Definition of Standard ML (Revised). MIT Press, May 1997 Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. The ML Kit. http://www.it-c.dk/research/mlkit/, 2002Google ScholarGoogle Scholar
  21. Scott Nettles and James O'Toole. Real-time replication garbage collection. ACM SIG\-PLAN Notices, 28(6):217--226, 1993 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Kelvin Nilsen. Issues in the design and implementation of real-time Java. Java Developer's Journal, 1(1):44, 1996Google ScholarGoogle Scholar
  23. Ran Shaham, Elliot Kolodner, and Mooly Sagiv. Heap profiling for space-efficient Java. ACM SIG-PLAN Notices, 36(5):104--113, May 2001 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Alexandru Sualcianu and Martin C. Rinard. Pointer and escape analysis for multithreaded programs. In Principles Practice of Parallel Programming, pages 12--23, 2001 Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Mads Tofte. A brief introduction to regions. Proceedings of the International Symposium on Memory Management (ISMM), pages 186--195, 1998 Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Mads Tofte and Jean-Pierre Talpin. Region-based memory management. Information and Computation, 132(2):109--176, February 1997 Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. F. Vivien and M. Rinard. Incrementalized pointer and escape analysis. In Proceedings of the SIGPLAN '01 Conference on Program Language Design and Implementation, Snowbird, Utah, June 2001 Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. John Whaley and Martin Rinard. Compositional pointer and escape analysis for Java programs. ACM SIG-PLAN Notices, 34(10):187--206, 1999 Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Paul R. Wilson. Uniprocessor garbage collection techniques (Long Version). Submitted to ACM Computing Surveys, 1994Google ScholarGoogle Scholar

Index Terms

  1. Automated discovery of scoped memory regions for real-time 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

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 38, Issue 2 supplement
      MSP 2002 and ISMM 2002
      February 2003
      291 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/773039
      Issue’s Table of Contents
      • cover image ACM Conferences
        ISMM '02: Proceedings of the 3rd international symposium on Memory management
        June 2002
        192 pages
        ISBN:1581135394
        DOI:10.1145/512429

      Copyright © 2002 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: 20 June 2002

      Check for updates

      Qualifiers

      • article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader