Abstract
Memory management is a source of unpredictability in the execution time of Java programs. This is because garbage collection introduces possibly unbounded blocking pauses to threads, which is unacceptable in real-time systems. To cope with this problem, the Real-Time Specification for Java (RTSJ) adopts a region-based approach which relies on memory scopes that are automatically freed upon termination of their lifetime. This allows the turning off of garbage collection during the execution of critical tasks, thus ensuring real-time guarantees. This chapter explains the RTSJ memory model and proposes improvements to its suggested implementation. It also discusses a static analysis-based approach to ensure that memory scopes are correctly use and dimensioned at compile time.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
We consider as non-outer region all scoped regions that are not entered by a considered real-time thread before to enter the considered region (i.e., scoped regions which are not bellow the considered region in the scoped stack of a given control flow).
- 2.
- 3.
Illegal assignments are pointers from a non-scoped MR (i.e., heap or an immortal MR) to a scoped one, or from a scoped region to a non-outer scoped region. Pointers to a non-scoped region are always allowed.
- 4.
This exception is thrown upon any attempt to refer to an object in an inaccessible MemoryArea.
- 5.
when executing putfield, putstatic, astore, or aastore bytecodes.
- 6.
The pauses introduced by this collector provides constant pause times, which makes it possible to run this collector with multimedia applications. But it is not adequate for hard real-time applications because the guaranteed upper limit on pause times is too large.
- 7.
References
H.G. Baker. The treadmill: real-time garbage collection without motion sickness. SIGPLAN Not., 27(3):66ā70, 1992.
P. Basanta-Val, M. Garcia-Valls, and I. Estevez-Ayres. Agcmemory: A new real-time Java region type for automatic floating garbage recycling. ACM SIGBED, 2(3), July 2005.
P. Basanta-Val, M. Garcia-Valls, and I. Estevez-Ayres. Enhancing the region model of real-time Java for large-scale systems. In 2nd Workshop on High Performance, Fault Adaptative, Large Scale Embedded Real-Time Systems, May 2005.
P. Basanta-Val, M. Garcia-Valls, and I. Estevez-Ayres. Extendedportal: violating the assignment rule and enforcing the single parent one. In 4th International Workshop on Java Technologies for Real-Time and Embedded Systems, page 37, October 2006.
W. S. Beebee and M. C. Rinard. An implementation of scoped memory for real-time Java. In EMSOFT, pages 289ā305, 2001.
E. Benowitz and A. Niessner. A patterns catalog for RTSJ software designs. In Workshop on Java Technologies for Real-Time and Embedded Systems (JTRES), Lecture Notes in Computer Science, volume 2889, pages 497ā507, 2003.
B. Blanchet. Escape analysis for JavaTM: Theory and practice. ACM Trans. Program. Lang. Syst., 25(6):713ā775, November 2003.
G. Bollella, T. Canham, V. Carson, V. Champlin, D. Dvorak, B. Giovannoni, M. Indictor, K. Meyer, A. Murray, and K. Reinholtz. Programming with non-heap memory in the real time specification for Java. In OOPSLA Companion, pages 361ā369, 2003.
G. Bollella, J. Gosling, B. Brosgol, P. Dibble, S. Furr, and M. Turnbull. The Real-Time Specification for Java. Java Series. Addison-Wesley, June 2000.
G. Bollella and K. Reinholtz. Scoped memory. In Symposium on Object-Oriented Real-Time Distributed Computing, pages 23ā25, 2002.
A. Borg and A. J. Wellings. Reference objects for RTSJ memory areas. In OTM Workshops, pages 397ā410, 2003.
V. A. Braberman, F. FernĆ”ndez, D. Garbervetsky, and S. Yovine. Parametric prediction of heap memory requirements. In ISMMā08: Proceedings of the 7th international symposium on Memory management, pages 141ā150, New York, 2008. ACM.
V. A. Braberman, D. Garbervetsky, and S. Yovine. A static analysis for synthesizing parametric specifications of dynamic memory consumption. Journal of Object Technology, 5(5):31ā58, 2006.
S. Cherem and R. Rugina. Region analysis and transformation for Java programs. In ISMM, pages 85ā96, 2004.
W-N. Chin, F. Craciun, S. Qin, and M. C. Rinard. Region inference for an object-oriented language. In PLDI, pages 243ā254, 2004.
J-D. Choi, M. Gupta, M. J. Serrano, V. C. Sreedhar, and S. P. Midkiff. Stack allocation and synchronization optimizations for Java using escape analysis. ACM Trans. Program. Lang. Syst., 25(6):876ā910, 2003.
P. Clauss. Counting solutions to linear and nonlinear constraints through ehrhart polynomials: Applications to analyze and transform scientific programs. In International Conference on Supercomputing, pages 278ā285, 1996.
A. Corsaro and R. Cytron. Efficient memory-reference checks for real-time Java. In LCTES, pages 51ā58, 2003.
A. Corsaro and C. Santoro. Design patterns for RTSJ application development. In OTM Workshops, pages 394ā405, 2004.
A. Corsaro and D.C. Schmidt. The design and performance of real-time Java middleware. IEEE Transactions on Parallel and Distributed Systems, 14(11):1155ā1167, November 2003.
M. Deters and R. Cytron. Automated discovery of scoped memory regions for real-time Java. In MSP/ISMM, pages 132ā142, 2002.
P. Dibble. RTSJ 1.1 alpha 6 release notes. Available at http://www.rtsj.org/specjavadoc/book_index.html.
P. Dibble. The current status of the RTSJ and jsr 282. In Proceedings of the 4th International Workshop on Java Technologies for Real-time and Embedded Systems, JTRES ā06, pages 1ā1, New York, NY, USA, 2006. ACM.
P. Dibble and et al. Java Specification Request 282 (RTSJ 1.1). Available at http://jcp.org/en/jsr/detail?id=282.
P. Dibble and A.J. Wellings. Jsr-282 status report. In Proceedings of the 7th International Workshop on Java Technologies for Real-Time and Embedded Systems, JTRESā09, pages 179ā182, New York, NY, USA, 2009. ACM.
P.C. Dibble. Real-Time Java Platform Programming. Amazon, 2nd edition, 2008.
S. Dieckmann and U. Hƶlzle. A study of the allocation behavior of the SPECjvm98 Java benchmark. In ECOOP, pages 92ā115, 1999.
E.W. Dijkstra, L. Lamport, A. J. Martin, C. S. Scholten, and E. F. M. Steffens. On-the-fly garbage collection: An exercise in cooperation. In Lecture Notes in Computer Science, No. 46. Springer-Verlag, New York, 1976.
A. Ferrari, D. Garbervetsky, V. A. Braberman, P. Listingart, and S. Yovine. Jscoper: Eclipse support for research on scoping and instrumentation for real time Java applications. In ETX, pages 50ā54, 2005.
D. Garbervetsky, C. Nakhli, S. Yovine, and H. Zorgati. Program instrumentation and run-time analysis of scoped memory in Java. Electr. Notes Theor. Comput. Sci., 113:105ā121, 2005.
D. Garbervetsky, S. Yovine, V. A. Braberman, M. Rouaux, and A. Taboada. Quantitative dynamic-memory analysis for Java. CCPE, (doi: 10.1002/cpe.1656), Nov 2010.
D. Gay and A. Aiken. Memory management with explicit regions. In PLDI, pages 313ā323, 1998.
D. Gay and B. Steensgaard. Fast escape analysis and stack allocation for object-based programs. In CC, pages 82ā93, 2000.
R. Henriksson. Scheduling Garbage Collection in Embedded Systems. PhD thesis, Lund Institute of Technology, July 1998.
M.T. Higuera-Toledano. Hardware-based solution detecting illegal references in real-time Java. In ECRTS, pages 229ā237, 2003.
M.T. Higuera-Toledano. Towards an understanding of the behavior of the single parent rule in the RTSJ scoped memory model. In IEEE Real-Time and Embedded Technology and Applications Symposium, pages 470ā479, 2005.
M.T. Higuera-Toledano. Towards an analysis of race carrier conditions in real-time Java. In IPDPS, 2006.
M.T. Higuera-Toledano and V. Issarny. Improving the memory management performance of RTSJ. Concurrency and Computation: Practice and Experience, 17(5ā6):715ā737, 2005.
M.T. Higuera-Toledano, V. Issarny, M. BanĆ¢tre, G. Cabillic, JP. Lesot, and F. Parain. Region-based memory management for real-time Java. In ISORC, pages 387ā394, 2001.
M.T. Higuera-Toledano, V. Issarny, M. BanĆ¢tre, and F. Parain. Memory management for real-time Java: An efficient solution using hardware support. Real-Time Systems, 26(1):63ā87, 2004.
M. Hirzel, J. Henkel, A. Diwan, and M. Hind. Understanding the connectivity of heap objects. In MSP/ISMM, pages 143ā156, 2002.
R.L. Hudson, R. Morrison, J.E.B. Moss, and D.S. Munro. Garbage collecting the world: one car at a time. SIGPLAN Not., 32:162ā175, October 1997.
R.E. Jones and R. Lins. Garbage Collection: Algorithms for Automatic Dynamic Memory Management. Wiley, Chichester, July 1996. With a chapter on Distributed Garbage Collection by R. Lins.
T. Kalibera, J. Hagelberg, F. Pizlo, A. Plsek, B. Titzer, and J. Vitek. Cdx: a family of real-time Java benchmarks. In JTRESā09: Proceedings of the 7th International Workshop on Java Technologies for Real-Time and Embedded Systems, pages 41ā50, New York, NY, USA, 2009. ACM.
A. Kim and J.M. Chang. Designing a Java microprocessor core using fpga technology. IEE Computing & Control Engineering Journal, 11(3):135ā141, June 2000.
F. Pizlo, J. M. Fox, D. Holmes, and J. Vitek. Real-time Java scoped memory: Design patterns and semantics. In Proceedings of the 7th IEEE International Symposium on Object-Oriented Real-Time Distributed Computing (ISORC 2004), pages 101ā110, 2004.
A. Plsek, L. Zhao, V.H. Sahin, D. Tang, T. Kalibera, and J. Vitek. Developing safety critical Java applications with oSCJ/L0. In JTRES, pages 95ā101, 2010.
K. Raman, Y. Zhang, M. Panahi, J.A. Colmenares, and R. Klefstad. Patterns and tools for achieving predictability and performance with real-time Java. In RTCSAā05: Proceedings of the 11th IEEE International Conference on Embedded and Real-Time Computing Systems and Applications (RTCSAā05), pages 247ā253, Washington, DC, USA, 2005. IEEE Computer Society.
T. Ritzau and P. Fritzson. Decreasing memory overhead in hard real-time garbage collection. In EMSOFT, pages 213ā226, 2002.
G. Salagnac, C. Rippert, and S. Yovine. Semi-automatic region-based memory management for real-time Java embedded systems. In RTCSA, pages 73ā80, 2007.
G. Salagnac, S. Yovine, and D. Garbervetsky. Fast escape analysis for region-based memory management. Electr. Notes Theor. Comput. Sci., 131:99ā110, 2005.
A. Salcianu and M. C. Rinard. Pointer and escape analysis for multithreaded programs. In PPOPP, pages 12ā23, 2001.
T. Schoofs, E. Jenn, S. Leriche, K. Nilsen, L. Gauthier, and M. Richard-Foy. Use of perc pico in the AIDA avionics platform. In JTRES, pages 169ā178, 2009.
J. Seligmann and S. Grarup. Incremental mature garbage collection using the train algorithm. In Proceedings of the 9th European Conference on Object-Oriented Programming, ECOOPā95, pages 235ā252, London, UK, UK, 1995. Springer-Verlag.
F. Siebert. Eliminating external fragmentation in a non-moving garbage collector for Java. In Proceedings of the 2000 international conference on Compilers, architecture, and synthesis for embedded systems (CASES 2000), pages 9ā17, New York, NY, USA, 2000. ACM.
F. Siebert. Realtime garbage collection in the JamaicaVM 3.0. In JTRES, pages 94ā103, 2007.
Sun Microsystems. picojava-ii(tm) microarchitecture guide, March 1999.
Sun Microsystems. The Javahotspot virtual machine, v1.4.1, 2002.
M. Tofte, L. Birkedal, M. Elsman, and N. Hallenberg. A retrospective on region-based memory management. Higher-Order and Symbolic Computation, 17(3):245ā265, 2004.
M. Tofte and JP. Talpin. Region-based memory management. Inf. Comput., 132(2):109ā176, 1997.
J. Whaley and M. C. Rinard. Compositional pointer and escape analysis for Java programs. In OOPSLA, pages 187ā206, 1999.
P. Wilson. Uniprocessor garbage collection techniques. In Yves Bekkers and Jacques Cohen, editors, Memory Management, volume 637 of Lecture Notes in Computer Science, pages 1ā42. Springer Berlin / Heidelberg, 1992. 10.1007/BFb0017182.
B. Zorn. Barrier methods for garbage collection. Technical Report CU-CS-494-90, University of Colorado, November 1990.
Acknowledgements
This research was supported by the Research Program S2009/TIC-1468, and by Ministerio de EducaciĆ³n y Ciencia, through the research grant TIN2009-.07146.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
Ā© 2012 Springer Science+Business Media, LLC
About this chapter
Cite this chapter
Higuera-Toledano, M.T., Yovine, S., Garbervetsky, D. (2012). Region-Based Memory Management: An Evaluation of Its Support in RTSJ. In: Higuera-Toledano, M., Wellings, A. (eds) Distributed, Embedded and Real-time Java Systems. Springer, Boston, MA. https://doi.org/10.1007/978-1-4419-8158-5_5
Download citation
DOI: https://doi.org/10.1007/978-1-4419-8158-5_5
Published:
Publisher Name: Springer, Boston, MA
Print ISBN: 978-1-4419-8157-8
Online ISBN: 978-1-4419-8158-5
eBook Packages: EngineeringEngineering (R0)