javax.realtime
Class GarbageCollector
java.lang.Object
javax.realtime.GarbageCollector
- public abstract class GarbageCollector
- extends java.lang.Object
The system shall provide dynamic and static information characterizing
the temporal behavior and imposed overhead of any garbage collection
algorithm provided by the system. This information shall be made available
to applications via methods on subclasses of
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()
.
Method Summary |
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 preemption-safe point. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GarbageCollector
public GarbageCollector()
getPreemptionLatency
public 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 preemption-safe point.
Instances of
NoHeapRealtimeThread
and async event handlers with the no-heap option preempt garbage
collection immediately, but other schedulable objects must wait until
the collector reaches a preemption-safe point. For many garbage collectors
the only preemption safe point is at the end of garbage collection, but an
implementation of the garbage collector could permit a schedulable object
to preempt garbage collection before it completes. The
getPreemptionLatency
method gives such a garbage collector a
way to report the worst-case interval between release of a schedulable
object during garbage collection, and the time the schedulable object
starts execution or gains full access to heap memory, whichever comes later.
- Returns:
- The worst-case preemption latency of the garbage collection
algorithm represented by this. The returned object is allocated in the
current allocation context. If 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.