Nothing Special   »   [go: up one dir, main page]

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

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

eBook
USD 15.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

Similar content being viewed by others

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