Nonblocking real-time garbage collection

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.

[1]  Guy L. Steele,et al.  Multiprocessing compactifying garbage collection , 1975, CACM.

[2]  Peter Reichel,et al.  Secure, Real-Time and Multi-Threaded General-Purpose Embedded Java Microarchitecture , 2007 .

[3]  Erez Petrank,et al.  An on-the-fly mark and sweep garbage collector based on sliding views , 2003, OOPSLA '03.

[4]  Martin Schoeberl,et al.  WCET analysis for a Java processor , 2006, JTRES '06.

[5]  Christof Pitter,et al.  Time-predictable memory arbitration for a Java chip-multiprocessor , 2008, JTRES '08.

[6]  Kelvin D. Nilsen,et al.  Cost-effective object space management for hardware-assisted real-time garbage collection , 1992, LOPL.

[7]  Fridtjof Siebert,et al.  Eliminating external fragmentation in a non-moving garbage collector for Java , 2000, CASES '00.

[8]  Martin Schoeberl,et al.  Non-blocking root scanning for real-time garbage collection , 2008, JTRES '08.

[9]  Leslie Lamport,et al.  On-the-fly garbage collection: an exercise in cooperation , 1975, CACM.

[10]  Martin Schoeberl,et al.  Architecture for object-oriented programming languages , 2007, JTRES.

[11]  Sven Gestegard Robertz,et al.  Time-triggered garbage collection: robust and adaptive real-time GC scheduling for embedded systems , 2003, LCTES '03.

[12]  Martin Schoeberl,et al.  A Java processor architecture for embedded real-time systems , 2008, J. Syst. Archit..

[13]  Filip Pizlo,et al.  Stopless: a real-time garbage collector for multiprocessors , 2007, ISMM '07.

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

[15]  Martin Schoeberl,et al.  Non-blocking object copy for real-time garbage collection , 2008, JTRES '08.

[16]  V. T. Rajan,et al.  Controlling fragmentation and space consumption in the metronome, a real-time garbage collector for Java , 2003, LCTES '03.

[17]  James R. Larus,et al.  A concurrent copying garbage collector for languages that distinguish (im)mutable data , 1993, PPOPP '93.

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

[19]  Peter Reichel,et al.  Secure, Real-Time and Multi-Threaded General-Purpose Embedded Java Microarchitecture , 2007, 10th Euromicro Conference on Digital System Design Architectures, Methods and Tools (DSD 2007).

[20]  Joshua S. Auerbach,et al.  Design and implementation of a comprehensive real-time java virtual machine , 2007, EMSOFT '07.

[21]  Fridtjof Siebert,et al.  Constant-Time Root Scanning for Deterministic Garbage Collection , 2001, CC.

[22]  S. L. Graham,et al.  List Processing in Real Time on a Serial Computer , 1978 .

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

[24]  Martin Schoeberl Real-time garbage collection for Java , 2006, Ninth IEEE International Symposium on Object and Component-Oriented Real-Time Distributed Computing (ISORC'06).

[25]  Rafael Dueire Lins,et al.  Garbage collection: algorithms for automatic dynamic memory management , 1996 .

[26]  Erez Petrank,et al.  An on-the-fly mark and sweep garbage collector based on sliding views , 2003, OOPSLA 2003.

[27]  V. T. Rajan,et al.  A real-time garbage collector with low overhead and consistent utilization , 2003, POPL '03.

[28]  Zoran A. Salcic,et al.  Designing a Concurrent Hardware Garbage Collector for Small Embedded Systems , 2005, Asia-Pacific Computer Systems Architecture Conference.

[29]  Matthias Meyer,et al.  A true hardware read barrier , 2006, ISMM '06.

[30]  James W. Layland,et al.  Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Environment , 1989, JACM.

[31]  Sven Gestegard Robertz,et al.  Time-triggered garbage collection: robust and adaptive real-time GC scheduling for embedded systems , 2003 .

[32]  Peter Lee,et al.  Generational stack collection and profile-driven pretenuring , 1998, PLDI.

[33]  Damien Doligez,et al.  Portable, unobtrusive garbage collection for multiprocessor systems , 1994, POPL '94.

[34]  Damien Doligez,et al.  A concurrent, generational garbage collector for a multithreaded implementation of ML , 1993, POPL '93.

[35]  Filip Pizlo,et al.  A study of concurrent real-time garbage collectors , 2008, PLDI '08.

[36]  Martin Schoeberl A Time Predictable Java Processor , 2006, Proceedings of the Design Automation & Test in Europe Conference.

[37]  Kelvin D. Nilsen,et al.  Performance of a hardware-assisted real-time garbage collector , 1994, ASPLOS VI.

[38]  Michael Wolf,et al.  The pauseless GC algorithm , 2005, VEE '05.

[39]  James Gosling,et al.  The Java Language Specification, 3rd Edition , 2005 .

[40]  Guy L. Steele,et al.  Java(TM) Language Specification, The (3rd Edition) (Java (Addison-Wesley)) , 2005 .

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

[42]  John H. Reppy,et al.  Concurrent garbage collection on stock hardware , 1987, FPCA.

[43]  Taiichi Yuasa,et al.  Real-time garbage collection on general-purpose machines , 1990, J. Syst. Softw..

[44]  Rodney A. Brooks,et al.  Trading data space for reduced time and code space in real-time garbage collection on stock hardware , 1984, LFP '84.

[45]  Jan Vitek,et al.  Garbage collection for safety critical Java , 2007, JTRES.

[46]  Erez Petrank,et al.  An on-the-fly reference counting garbage collector for Java , 2001, OOPSLA '01.