public abstract class GarbageCollector
extends java.lang.Object
GarbageCollector
. Implementations are
allowed to provide any set of methods in subclasses as long as the
temporal behavior and overhead are sufficiently categorized. The
implementations are also required to fully document the subclasses.
A reference to the garbage collector responsible for heap memory is
available from RealtimeSystem.currentGC()
.
Modifier and Type | Method and Description |
---|---|
abstract RelativeTime |
getPreemptionLatency()
Preemption latency is a measure of the maximum time a schedulable
object may have to wait for the collector to reach a safe point.
|
public abstract RelativeTime getPreemptionLatency()
Schedulables which may not use the heap preempt garbage
collection immediately, but other schedulables must wait until the
collector reaches a safe point. For many garbage
collectors the only safe point is at the end of garbage
collection, but an implementation of the garbage collector could
permit a schedulable to preempt garbage collection before it
completes. The getPreemptionLatency
method gives such
a garbage collector a way to report the worst-case interval between
the release of a schedulable during garbage collection, and the
time the schedulable starts execution or gains full access
to heap memory, whichever comes later.
this
. The
returned object is allocated in the current allocation
context. When there is no constant that bounds garbage
collector preemption latency, this method shall return a
relative time with Long.MAX_VALUE
milliseconds. The number of nanoseconds in this special
value is unspecified.