public interface CollectionPolicy
| Modifier and Type | Interface and Description |
|---|---|
static class |
CollectionPolicy.Options |
| Modifier and Type | Method and Description |
|---|---|
void |
ensureSizeParametersInitialized()
Ensures that size parameters have been computed and methods like
CollectionPolicy.getMaximumHeapSize()
provide reasonable values, but do not force a recomputation of the size parameters like
CollectionPolicy.updateSizeParameters(). |
org.graalvm.word.UnsignedWord |
getCurrentHeapCapacity()
The current limit for the size of the entire heap, which is less than or equal to
CollectionPolicy.getMaximumHeapSize(). |
static CollectionPolicy |
getInitialPolicy() |
static String |
getInitialPolicyName() |
org.graalvm.word.UnsignedWord |
getMaximumFreeAlignedChunksSize()
The maximum number of bytes that should be kept readily available for allocation or copying
during collections.
|
org.graalvm.word.UnsignedWord |
getMaximumHeapSize()
The hard limit for the size of the entire heap.
|
org.graalvm.word.UnsignedWord |
getMaximumYoungGenerationSize()
The maximum capacity of the young generation, comprising eden and survivor spaces.
|
static int |
getMaxSurvivorSpaces(Integer userValue) |
org.graalvm.word.UnsignedWord |
getMinimumHeapSize()
The minimum heap size, for inclusion in diagnostic output.
|
String |
getName() |
org.graalvm.word.UnsignedWord |
getSurvivorSpacesCapacity()
The total capacity of all survivor-from spaces of all ages, equal to the size of all
survivor-to spaces of all ages.
|
int |
getTenuringAge()
The age at which objects should currently be promoted to the old generation, which is between
1 (straight from eden) and the number of
survivor spaces + 1.
|
void |
onCollectionBegin(boolean completeCollection,
long requestingNanoTime)
Called at the beginning of a collection, in the safepoint operation.
|
void |
onCollectionEnd(boolean completeCollection,
GCCause cause)
Called before the end of a collection, in the safepoint operation.
|
boolean |
shouldCollectCompletely(boolean followingIncrementalCollection)
At a safepoint, decides whether to do a complete collection (returning
true) or an
incremental collection (returning false). |
boolean |
shouldCollectOnAllocation()
During a slow-path allocation, determines whether to trigger a collection.
|
static boolean |
shouldCollectYoungGenSeparately(boolean defaultValue) |
void |
updateSizeParameters()
(Re)computes minimum/maximum/initial sizes of space based on the available
physical memory and current runtime option values.
|
static String getInitialPolicyName()
static CollectionPolicy getInitialPolicy()
static int getMaxSurvivorSpaces(Integer userValue)
static boolean shouldCollectYoungGenSeparately(boolean defaultValue)
String getName()
void ensureSizeParametersInitialized()
CollectionPolicy.getMaximumHeapSize()
provide reasonable values, but do not force a recomputation of the size parameters like
CollectionPolicy.updateSizeParameters().void updateSizeParameters()
boolean shouldCollectOnAllocation()
true will initiate a safepoint during which CollectionPolicy.shouldCollectCompletely(boolean) will be
called followed by the collection.boolean shouldCollectCompletely(boolean followingIncrementalCollection)
true) or an
incremental collection (returning false).followingIncrementalCollection - whether an incremental collection has just finished in
the same safepoint. Implementations would typically decide whether to follow up
with a full collection based on whether enough memory was reclaimed.org.graalvm.word.UnsignedWord getCurrentHeapCapacity()
CollectionPolicy.getMaximumHeapSize().
NOTE: this can currently be exceeded during a collection while copying objects in the old
generation.org.graalvm.word.UnsignedWord getMaximumHeapSize()
OutOfMemoryError.
NOTE: this can currently be exceeded during a collection while copying objects in the old
generation.org.graalvm.word.UnsignedWord getMaximumYoungGenerationSize()
org.graalvm.word.UnsignedWord getMinimumHeapSize()
org.graalvm.word.UnsignedWord getSurvivorSpacesCapacity()
org.graalvm.word.UnsignedWord getMaximumFreeAlignedChunksSize()
int getTenuringAge()
void onCollectionBegin(boolean completeCollection,
long requestingNanoTime)
void onCollectionEnd(boolean completeCollection,
GCCause cause)