Skip to main content

Region-Based Memory Management: An Evaluation of Its Support in RTSJ

  • Chapter
  • First Online:
Distributed, Embedded and Real-time Java Systems

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 159.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 109.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 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. 2.

    http://www.spec.org/osg/jvm98.

  3. 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. 4.

    This exception is thrown upon any attempt to refer to an object in an inaccessible MemoryArea.

  5. 5.

    when executing putfield, putstatic, astore, or aastore bytecodes.

  6. 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. 7.

    http://adam.lille.inria.fr/soleil/rcd/.

References

  1. H.G. Baker. The treadmill: real-time garbage collection without motion sickness. SIGPLAN Not., 27(3):66ā€“70, 1992.

    ArticleĀ  Google ScholarĀ 

  2. 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.

    Google ScholarĀ 

  3. 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.

    Google ScholarĀ 

  4. 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.

    Google ScholarĀ 

  5. W. S. Beebee and M. C. Rinard. An implementation of scoped memory for real-time Java. In EMSOFT, pages 289ā€“305, 2001.

    Google ScholarĀ 

  6. 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.

    Google ScholarĀ 

  7. B. Blanchet. Escape analysis for JavaTM: Theory and practice. ACM Trans. Program. Lang. Syst., 25(6):713ā€“775, November 2003.

    ArticleĀ  MathSciNetĀ  Google ScholarĀ 

  8. 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.

    Google ScholarĀ 

  9. 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.

    Google ScholarĀ 

  10. G. Bollella and K. Reinholtz. Scoped memory. In Symposium on Object-Oriented Real-Time Distributed Computing, pages 23ā€“25, 2002.

    Google ScholarĀ 

  11. A. Borg and A. J. Wellings. Reference objects for RTSJ memory areas. In OTM Workshops, pages 397ā€“410, 2003.

    Google ScholarĀ 

  12. 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.

    Google ScholarĀ 

  13. 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.

    ArticleĀ  Google ScholarĀ 

  14. S. Cherem and R. Rugina. Region analysis and transformation for Java programs. In ISMM, pages 85ā€“96, 2004.

    Google ScholarĀ 

  15. W-N. Chin, F. Craciun, S. Qin, and M. C. Rinard. Region inference for an object-oriented language. In PLDI, pages 243ā€“254, 2004.

    Google ScholarĀ 

  16. 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.

    Google ScholarĀ 

  17. 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.

    Google ScholarĀ 

  18. A. Corsaro and R. Cytron. Efficient memory-reference checks for real-time Java. In LCTES, pages 51ā€“58, 2003.

    Google ScholarĀ 

  19. A. Corsaro and C. Santoro. Design patterns for RTSJ application development. In OTM Workshops, pages 394ā€“405, 2004.

    Google ScholarĀ 

  20. 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.

    ArticleĀ  Google ScholarĀ 

  21. M. Deters and R. Cytron. Automated discovery of scoped memory regions for real-time Java. In MSP/ISMM, pages 132ā€“142, 2002.

    Google ScholarĀ 

  22. P. Dibble. RTSJ 1.1 alpha 6 release notes. Available at http://www.rtsj.org/specjavadoc/book_index.html.

  23. 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.

    Google ScholarĀ 

  24. P. Dibble and et al. Java Specification Request 282 (RTSJ 1.1). Available at http://jcp.org/en/jsr/detail?id=282.

  25. 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.

    Google ScholarĀ 

  26. P.C. Dibble. Real-Time Java Platform Programming. Amazon, 2nd edition, 2008.

    Google ScholarĀ 

  27. S. Dieckmann and U. Hƶlzle. A study of the allocation behavior of the SPECjvm98 Java benchmark. In ECOOP, pages 92ā€“115, 1999.

    Google ScholarĀ 

  28. 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.

    Google ScholarĀ 

  29. 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.

    Google ScholarĀ 

  30. 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.

    ArticleĀ  Google ScholarĀ 

  31. 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.

    Google ScholarĀ 

  32. D. Gay and A. Aiken. Memory management with explicit regions. In PLDI, pages 313ā€“323, 1998.

    Google ScholarĀ 

  33. D. Gay and B. Steensgaard. Fast escape analysis and stack allocation for object-based programs. In CC, pages 82ā€“93, 2000.

    Google ScholarĀ 

  34. R. Henriksson. Scheduling Garbage Collection in Embedded Systems. PhD thesis, Lund Institute of Technology, July 1998.

    Google ScholarĀ 

  35. M.T. Higuera-Toledano. Hardware-based solution detecting illegal references in real-time Java. In ECRTS, pages 229ā€“237, 2003.

    Google ScholarĀ 

  36. 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.

    Google ScholarĀ 

  37. M.T. Higuera-Toledano. Towards an analysis of race carrier conditions in real-time Java. In IPDPS, 2006.

    Google ScholarĀ 

  38. 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.

    ArticleĀ  Google ScholarĀ 

  39. 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.

    Google ScholarĀ 

  40. 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.

    ArticleĀ  Google ScholarĀ 

  41. M. Hirzel, J. Henkel, A. Diwan, and M. Hind. Understanding the connectivity of heap objects. In MSP/ISMM, pages 143ā€“156, 2002.

    Google ScholarĀ 

  42. 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.

    ArticleĀ  Google ScholarĀ 

  43. 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.

    Google ScholarĀ 

  44. 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.

    Google ScholarĀ 

  45. 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.

    ArticleĀ  Google ScholarĀ 

  46. 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.

    Google ScholarĀ 

  47. 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.

    Google ScholarĀ 

  48. 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.

    Google ScholarĀ 

  49. T. Ritzau and P. Fritzson. Decreasing memory overhead in hard real-time garbage collection. In EMSOFT, pages 213ā€“226, 2002.

    Google ScholarĀ 

  50. 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.

    Google ScholarĀ 

  51. G. Salagnac, S. Yovine, and D. Garbervetsky. Fast escape analysis for region-based memory management. Electr. Notes Theor. Comput. Sci., 131:99ā€“110, 2005.

    ArticleĀ  Google ScholarĀ 

  52. A. Salcianu and M. C. Rinard. Pointer and escape analysis for multithreaded programs. In PPOPP, pages 12ā€“23, 2001.

    Google ScholarĀ 

  53. 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.

    Google ScholarĀ 

  54. 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.

    Google ScholarĀ 

  55. 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.

    Google ScholarĀ 

  56. F. Siebert. Realtime garbage collection in the JamaicaVM 3.0. In JTRES, pages 94ā€“103, 2007.

    Google ScholarĀ 

  57. Sun Microsystems. picojava-ii(tm) microarchitecture guide, March 1999.

    Google ScholarĀ 

  58. Sun Microsystems. The Javahotspot virtual machine, v1.4.1, 2002.

    Google ScholarĀ 

  59. 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.

    ArticleĀ  MATHĀ  Google ScholarĀ 

  60. M. Tofte and JP. Talpin. Region-based memory management. Inf. Comput., 132(2):109ā€“176, 1997.

    Google ScholarĀ 

  61. J. Whaley and M. C. Rinard. Compositional pointer and escape analysis for Java programs. In OOPSLA, pages 187ā€“206, 1999.

    Google ScholarĀ 

  62. 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.

    Google ScholarĀ 

  63. B. Zorn. Barrier methods for garbage collection. Technical Report CU-CS-494-90, University of Colorado, November 1990.

    Google ScholarĀ 

Download references

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

Authors

Corresponding author

Correspondence to M. Teresa Higuera-Toledano .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics