Automated discovery of scoped memory regions for real-time Java

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.

[1]  James Gosling,et al.  The Real-Time Specification for Java , 2000, Computer.

[2]  Guy E. Blelloch,et al.  A parallel, real-time garbage collector , 2001, PLDI '01.

[3]  Ron K. Cytron,et al.  Translation of Java to Real-Time Java Using Aspects , 2001 .

[4]  Jong-Deok Choi,et al.  Interprocedural pointer alias analysis , 1999, TOPL.

[5]  David Gay,et al.  Language support for regions , 2001, PLDI '01.

[6]  Bruno Blanchet,et al.  Escape analysis for object-oriented languages: application to Java , 1999, OOPSLA '99.

[7]  Martin Elsman,et al.  Combining region inference and garbage collection , 2002, PLDI '02.

[8]  Martin C. Rinard,et al.  Pointer and escape analysis for multithreaded programs , 2001, PPoPP '01.

[9]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[10]  Robin Milner,et al.  Definition of standard ML , 1990 .

[11]  Elliot K. Kolodner,et al.  Heap profiling for space-efficient Java , 2001, PLDI '01.

[12]  Scott Nettles,et al.  Real-time replication garbage collection , 1993, PLDI '93.

[13]  Mads Tofte A brief introduction to regions , 1998, ISMM '98.

[14]  Ron K. Cytron,et al.  Introduction of Program Instrumentation using Aspects , 2001 .

[15]  Frédéric Vivien,et al.  Incrementalized pointer and escape analysis , 2001, PLDI '01.

[16]  Martin C. Rinard,et al.  Compositional pointer and escape analysis for Java programs , 1999, OOPSLA '99.

[17]  Ken Arnold,et al.  The Java Programming Language , 1996 .

[18]  Kelvin Nilsen,et al.  Issues in the Design and Implementation of Real-Time Java , 1998 .

[19]  Ron Cytron,et al.  Contaminated garbage collection , 2000, PLDI '00.

[20]  Mads Tofte,et al.  Region-based Memory Management , 1997, Inf. Comput..

[21]  Paul R. Wilson,et al.  Uniprocessor Garbage Collection Techniques , 1992, IWMM.

[22]  Amer Diwan,et al.  Type-based alias analysis , 1998, PLDI.

[23]  Martin C. Rinard,et al.  An Implementation of Scoped Memory for Real-Time Java , 2001, EMSOFT.

[24]  Chung Laung Liu,et al.  Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Environment , 1989, JACM.

[25]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[26]  Barbara G. Ryder,et al.  A safe approximate algorithm for interprocedural aliasing , 1992, PLDI '92.

[27]  Jong-Deok Choi,et al.  Escape analysis for Java , 1999, OOPSLA '99.