public abstract class HeapGrowthManager extends Object
Modifier and Type | Field and Description |
---|---|
private static double |
accumulatedGCTime |
private static Extent |
currentHeapSize
The current heap size in bytes
|
private static long |
endLastMajorGC |
private static double[][] |
function
An encoding of the function used to manage heap size.
|
private static double[][] |
generationalFunction |
private static Extent |
initialHeapSize
The initial heap size (-Xms) in bytes
|
private static Extent |
maxHeapSize
The maximum heap size (-Xms) in bytes
|
private static double[][] |
nongenerationalFunction |
Constructor and Description |
---|
HeapGrowthManager() |
Modifier and Type | Method and Description |
---|---|
static void |
boot(Extent initial,
Extent max)
Initialize heap size parameters and the mechanisms
used to adaptively change heap size.
|
private static double |
computeHeapChangeRatio(double liveRatio) |
static boolean |
considerHeapSize()
Decide how to grow/shrink the heap to respond
to application's memory usage.
|
static Extent |
getCurrentHeapSize() |
static Extent |
getInitialHeapSize()
Return the initial heap size in bytes (as set by -Xms).
|
static Extent |
getMaxHeapSize()
Return the max heap size in bytes (as set by -Xmx).
|
static void |
overrideGrowHeapSize(Extent size)
Forcibly grow the heap by the given number of bytes.
|
static void |
recordGCTime(double time)
Record the time taken by the current GC;
used to compute gc load, one of the inputs
into the heap size management function
|
static void |
reset()
Reset timers used to compute gc load
|
private static void |
sanityCheck()
Check that function satisfies the invariants
|
private static Extent initialHeapSize
private static Extent maxHeapSize
private static Extent currentHeapSize
private static final double[][] generationalFunction
private static final double[][] nongenerationalFunction
private static final double[][] function
private static long endLastMajorGC
private static double accumulatedGCTime
public HeapGrowthManager()
public static void boot(Extent initial, Extent max)
initial
- the initial heap sizemax
- the maximum heap sizepublic static Extent getCurrentHeapSize()
public static Extent getMaxHeapSize()
public static Extent getInitialHeapSize()
public static void overrideGrowHeapSize(Extent size)
size
- number of bytes to grow the heappublic static void recordGCTime(double time)
time
- number of time taking for current GC, in
millisecondspublic static void reset()
public static boolean considerHeapSize()
true
if heap size was changed, false
otherwiseprivate static double computeHeapChangeRatio(double liveRatio)
private static void sanityCheck()