APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.rmi.transport

pack-priv Class GC

extends Object
Class Inheritance
Annotations
@SuppressWarnings:restricted
Imports
java.util.SortedSet, .TreeSet, jdk.internal.misc.InnocuousThread

Support for garbage-collection latency requests.
Author
Mark Reinhold
Since
1.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
public static class
GC.LatencyRequest

Represents an active garbage-collection latency request.

Field Summary

Modifier and TypeField and Description
private static Thread
private static long
private static Object
private static final long

Constructor Summary

AccessConstructor and Description
private
GC()

Method Summary

Modifier and TypeMethod and Description
public static long
currentLatencyTarget()

Returns the current smallest garbage-collection latency request, or zero if there are no active requests.

public static native long
maxObjectInspectionAge()

Returns the maximum object-inspection age, which is the number of real-time milliseconds that have elapsed since the least-recently-inspected heap object was last inspected by the garbage collector.

public static GC.LatencyRequest
requestLatency(long
The requested latency
latency
)

Makes a new request for a garbage-collection latency of the given number of real-time milliseconds.

private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

daemonback to summary
private static Thread daemon
latencyTargetback to summary
private static long latencyTarget
lockback to summary
private static Object lock
NO_TARGETback to summary
private static final long NO_TARGET

Constructor Detail

GCback to summary
private GC()

Method Detail

currentLatencyTargetback to summary
public static long currentLatencyTarget()

Returns the current smallest garbage-collection latency request, or zero if there are no active requests.

maxObjectInspectionAgeback to summary
public static native long maxObjectInspectionAge()

Returns the maximum object-inspection age, which is the number of real-time milliseconds that have elapsed since the least-recently-inspected heap object was last inspected by the garbage collector.

For simple stop-the-world collectors this value is just the time since the most recent collection. For generational collectors it is the time since the oldest generation was most recently collected. Other collectors are free to return a pessimistic estimate of the elapsed time, or simply the time since the last full collection was performed.

Note that in the presence of reference objects, a given object that is no longer strongly reachable may have to be inspected multiple times before it can be reclaimed.

requestLatencyback to summary
public static GC.LatencyRequest requestLatency(long latency)

Makes a new request for a garbage-collection latency of the given number of real-time milliseconds. A low-priority daemon thread makes a best effort to ensure that the maximum object-inspection age never exceeds the smallest of the currently active requests.

Parameters
latency:long

The requested latency

Exceptions
IllegalArgumentException:
If the given latency is non-positive
setLatencyTargetback to summary
private static void setLatencyTarget(long ms)
sun.rmi.transport back to summary

private Class GC.Daemon

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Daemonback to summary
private Daemon()

Method Detail

createback to summary
public static void create()
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
sun.rmi.transport back to summary

private Class GC.LatencyLock

extends Object
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

LatencyLockback to summary
private LatencyLock()
sun.rmi.transport back to summary

public Class GC.LatencyRequest

extends Object
implements Comparable<GC.LatencyRequest>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable

Represents an active garbage-collection latency request. Instances of this class are created by the requestLatency method. Given a request, the only interesting operation is that of cancellation.

Field Summary

Modifier and TypeField and Description
private static long
private long
private long
private static SortedSet<GC.LatencyRequest>

Constructor Summary

AccessConstructor and Description
private
LatencyRequest(long ms)

Method Summary

Modifier and TypeMethod and Description
private static void
public void
cancel()

Cancels this latency request.

public int
compareTo(GC.LatencyRequest r)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

counterback to summary
private static long counter
idback to summary
private long id
latencyback to summary
private long latency
requestsback to summary
private static SortedSet<GC.LatencyRequest> requests

Constructor Detail

LatencyRequestback to summary
private LatencyRequest(long ms)

Method Detail

adjustLatencyIfNeededback to summary
private static void adjustLatencyIfNeeded()
cancelback to summary
public void cancel()

Cancels this latency request.

Exceptions
IllegalStateException:
If this request has already been cancelled
compareToback to summary
public int compareTo(GC.LatencyRequest r)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.