Time-Triggered Garbage Collection
Robust and Adaptive Real-Time GC Scheduling for Embedded Systems
Sven Gestegård Robertz and Roger Henriksson
Abstract
The advent of Java and similar languages on the real-time system scene necessitates the development of efficient strategies for scheduling the work of a garbage collector in a non-intrusive way. We propose a scheduling strategy, time-triggered garbage collection, based on assigning the collector a deadline for when it must complete its current cycle.
We show that a time-triggered GC with fixed deadline can have equal or better real-time performance than an allocation-triggered GC, which is the standard approach to real-time GC. Also, by using a deadline-based approach, the GC scheduling and, consequently, real-time performance, is independent of a complex and error-prone GC work metric.
Time-triggered GC allows a more high-level view on GC scheduling; we look at the GC cycle level rather than at the individual work increments. This makes it possible to schedule GC as any other thread. It is also suitable for making the GC auto-tuning by dynamically adjusting its deadline as necessary.
We have implemented our approach in a run-time system for Java and present experimental data to support the practical feasibility of the approach.