public class

GC

extends Object
java.lang.Object
   ↳ sun.misc.GC

Class Overview

Support for garbage-collection latency requests.

Summary

Nested Classes
class GC.LatencyRequest Represents an active garbage-collection latency request. 
Public Methods
static long currentLatencyTarget()
Returns the current smallest garbage-collection latency request, or zero if there are no active requests.
static 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.
static GC.LatencyRequest requestLatency(long latency)
Makes a new request for a garbage-collection latency of the given number of real-time milliseconds.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static long currentLatencyTarget ()

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

public static 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.

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 The requested latency
Throws
IllegalArgumentException If the given latency is non-positive