skip to main content
research-article

Nonblocking real-time garbage collection

Published:27 August 2010Publication History
Skip Abstract Section

Abstract

A real-time garbage collector has to fulfill two basic properties: ensure that programs with bounded allocation rates do not run out of memory and provide short blocking times. Even for incremental garbage collectors, two major sources of blocking exist, namely, root scanning and heap compaction. Finding root nodes of an object graph is an integral part of tracing garbage collectors and cannot be circumvented. Heap compaction is necessary to avoid probably unbounded heap fragmentation, which in turn would lead to unacceptably high memory consumption. In this article, we propose solutions to both issues.

Thread stacks are local to a thread, and root scanning, therefore, only needs to be atomic with respect to the thread whose stack is scanned. This fact can be utilized by either blocking only the thread whose stack is scanned, or by delegating the responsibility for root scanning to the application threads. The latter solution eliminates blocking due to root scanning completely. The impact of this solution on the execution time of a garbage collector is shown for two different variants of such a root scanning algorithm.

During heap compaction, objects are copied. Copying is usually performed atomically to avoid interference with application threads, which could render the state of an object inconsistent. Copying of large objects and especially large arrays introduces long blocking times that are unacceptable for real-time systems. In this article, an interruptible copy unit is presented that implements nonblocking object copy. The unit can be interrupted after a single word move.

We evaluate a real-time garbage collector that uses the proposed techniques on a Java processor. With this garbage collector, it is possible to run high-priority hard real-time tasks at 10 kHz parallel to the garbage collection task on a 100 MHz system.

References

  1. Auerbach, J., Bacon, D. F., Blainey, B., Cheng, P., Dawson, M., Fulton, M., Grove, D., Hart, D., and Stoodley, M. 2007. Design and implementation of a comprehensive real-time java virtual machine. In EMSOFT '07: Proceedings of the 7th ACM and IEEE International Conference on Embedded Software. ACM, New York, 249--258. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Azatchi, H., Levanoni, Y., Paz, H., and Petrank, E. 2003. An on-the-fly mark and sweep garbage collector based on sliding view. In Proceedings of the ACM Conference on Object-Oriented Systems, Languages and Applications (OOPSLA'03). ACM, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Bacon, D. F., Cheng, P., and Rajan, V. 2003a. Controlling fragmentation and space consumption in the Metronome, A real-time garbage collector for Java. In Proceedings of the ACM SIGPLAN Conference on Languages, Computers, and Tools for Embedded Systems (LCTES'03). Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Bacon, D. F., Cheng, P., and Rajan, V. 2003b. A real-time garbage collecor with low overhead and consistent utilization. In Conference Record of the 30th Annual ACM Symposium on Principles of Programming Languages. New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Baker, H. G. 1978. List processing in real-time on a serial computer. Comm. ACM 21, 4, 280--94. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Bollella, G., Gosling, J., Brosgol, B., Dibble, P., Furr, S., and Turnbull, M. 2000. The Real-Time Specification for Java. Java Series. Addison-Wesley, Reading, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Brooks, R. A. 1984. Trading data space for reduced time and code space in real-time garbage collection on stock hardware. In Conference Record of the ACM Symposium on Lisp and Functional Programming, ACM, New York, 256--262. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Cheng, P., Harper, R., and Lee, P. 1998. Generational stack collection and profile-driven pretenuring. In Proceedings of the SIGPLAN'8 Conference on Programming Languages Design and Implementation. ACM, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Click, C., Tene, G., and Wolf, M. 2005. The pauseless GC algorithm. In Proceedings of the 1st International Conference on Virtual Execution Environments, (VEE'05), ACM, New York, 46--56. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Dijkstra, E. W., Lamport, L., Martin, A. J., Scholten, C. S., and Steffens, E. F. M. 1978. On-the-fly garbage collection: An exercise in cooperation. Comm. ACM 21, 11, 965--975. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Doligez, D. and Gonthier, G. 1994. Portable, unobtrusive garbage collection for multiprocessor systems. In the Conference Record of the 21st Annual ACM Symposium on Principles of Programming Languages. ACM, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Doligez, D. and Leroy, X. 1993. A concurrent generational garbage collector for a multi-threaded implementation of ML. In the Conference Record of the 20th Annual ACM Symposium on Principles of Programming Languages. ACM, New York, 113--123. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Gosling, J., Joy, B., Steele, G., and Bracha, G. 2005. The Java Language Specification, 3rd Ed. The Java Series. Addison-Wesley, Reading MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Gruian, F. and Salcic, Z. 2005. Designing a concurrent hardware garbage collector for small embedded systems. In Proceedings of Advances in Computer Systems Architecture: 10th Asia-Pacific Conference, (ACSAC'03). Springer-Verlag, Berlin, 281--294. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Huelsbergen, L. and Larus, J. R. 1993. A concurrent copying garbage collector for languages that distinguish (im)mutable data. In Proceeding of the 4th Annual ACM Symposium on Principles and Practice of Parallel Programming. ACM, New York, 73--82. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Jones, R. E. 1996. Garbage Collection: Algorithms for Automatic Dynamic Memory Management. Wiley, Chichester. (With a chapter on Distributed Garbage Collection by R. Lins). Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Levanoni, Y. and Petrank, E. 2001. An on-the-fly reference counting garbage collector for Java. In Proceedings of the ACM Conference on Object-Oriented Systems, Languages and Application (OOPSLA'01), ACM, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Liu, C. L. and Layland, J. W. 1973. Scheduling algorithms for multiprogramming in a hard-real-time environment. J. ACM 20, 1, 46--61. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Meyer, M. 2006. A true hardware read barrier. In Proceedings of the 4th International Symposium on Memory Management (ISMM'06), ACM, New York, 3--16. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Nettles, S. M. and O'Toole, J. W. 1993. Real-time replication-based garbage collection. In Proceedings of SIGPLAN Conference on Programming Languages Design and Implementation. ACM, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Nilsen, K. D. and Schmidt, W. J. 1992. Cost-effective object-space management for hardware-assisted real-time garbage collection. Lett. Prog. Lang. Syst. 1, 4, 338--354. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. North, S. C. and Reppy, J. H. 1987. Concurrent garbage collection on stock hardware. In Conference Record of the Conference on Functional Programming and Computer Architecture. Lecture Notes in Computer Science, vol. 274. Springer-Verlag, Berlin, 113--133. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Pitter, C. 2008. Time-predictable memory arbitration for a Java chip-multiprocessor. In Proceedings of the 6th international workshop on Java Technologies for Real-Time and Embedded Systems (JTRES). ACM Press, New York, 115--122. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Pizlo, F., Frampton, D., Petrank, E., and Steensgard, B. 2007. STOPLESS: A real-time garbage collector for multiprocessors. In Proceedings of the 5th International Symposium on Memory Management (ISMM'07), ACM, New York, 159--172. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Pizlo, F., Petrank, E., and Steensgaard, B. 2008. A study of concurrent real-time garbage collectors. In Proceedings of the SIGPLAN Conference on Programming Languages Design and Implementation. ACM, New York, 33--44. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Puffitsch, W. and Schoeberl, M. 2008. Non-blocking root scanning for real-time garbage collection. In Proceedings of the 6th International Workshop on Java Technologies for Real-time and Embedded Systems (JTRES'08). Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Robertz, S. G. and Henriksson, R. 2003. Time-triggered garbage collection—robust and adaptive real-time GC scheduling for embedded systems. In Proceedings of the ACM SILPLAN Conference on Languages, Compilers, and Tools for Embedded Systems (LCTES'03). ACM, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Schmidt, W. J. and Nilsen, K. D. 1994. Performance of a hardware-assisted real-time garbage collector. In Proceedings of the 6th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS-VI). ACM, New York, 76--85. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Schoeberl, M. 2006a. Real-time garbage collection for Java. In Proceedings of the 9th IEEE International Symposium on Object and Component-Oriented Real-Time Distributed Computing (ISORC'06). IEEE Computer Society Press, Los Alamitos, CA, 424--432. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Schoeberl, M. 2006b. A time predictable Java processor. In Proceedings of the Design, Automation and Test in Europe Conference (DATE06), 800--805. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Schoeberl, M. 2007. Architecture for object oriented programming languages. In Proceedings of the 5th International Workshop on Java Technologies for Real-Time and Embedded Systems (JTRES'07). ACM, New York, 57--62. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Schoeberl, M. 2008. A Java processor architecture for embedded real-time systems. J. Syst. Arch. 54/1--2, 265--286. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Schoeberl, M. and Pedersen, R. 2006. WCET analysis for a Java processor. In Proceedings of the 4th International Workshop on Java Technologies for Real-time and Embedded Systems (JTRES06). ACM, New York, 202--211. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Schoeberl, M. and Puffitsch, W. 2008. Non-blocking object copy for real-time garbage collection. In Proceedings of the 6th International Workshop on Java Technologies for Real-time and Embedded Systems (JTRES08). ACM, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Schoeberl, M. and Vitek, J. 2007. Garbage collection for safety critical Java. In Proceedings of the 5th International WOrkshop on Java Technologies for Real-Time Systems (JTRES). ACM, New York, 85--93. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Siebert, F. 2000. Eliminating external fragmentation in a non-moving garbage collector for Java. In Proceedings of the Symposium on Compilers, Architectures and Synthesis for Embedded Systems (CASES'00). Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Siebert, F. 2001. Constant-time root scanning for deterministic garbage collection. In Proceedings of the 10th International Conference on Compiler Construction (CC'01). Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Steele, G. L. 1975. Multiprocessing compactifying garbage collection. Comm. ACM 18, 9, 495--508. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Wilson, P. R. 1994. Uniprocessor garbage collection techniques. Tech. rep., University of Texas.Google ScholarGoogle Scholar
  40. Wilson, P. R. and Johnstone, M. S. 1993. Truly real-time non-copying garbage collection. In Proceedings of the OOPSLA/ECOOP'93 Workshop on Garbage Collection in Object-Oriented Systems. ACM, New York.Google ScholarGoogle Scholar
  41. Yuasa, T. 1990. Real-time garbage collection on general-purpose machines. J. Syst. Softw. 11, 3, 181--198. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Yuasa, T. 2002. Return barrier. In Proceedings of the International Lisp Conference.Google ScholarGoogle Scholar
  43. Zabel, M., Preusser, T. B., Reichel, P., and Spallek, R. G. 2007. Secure, real-time and multi-threaded general-purpose embedded Java microarchitecture. In Prceedings of the 10th Euromicro Conference on Digital System Design Architectures, Methods and Tools (DSD'07). 59--62. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Nonblocking real-time garbage collection

      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

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!