public final class HeapImpl extends Heap
| Constructor and Description |
|---|
HeapImpl(int pageSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
attachThread(org.graalvm.nativeimage.IsolateThread isolateThread)
Notifies the heap that a new thread was attached to the VM.
|
org.graalvm.compiler.nodes.gc.BarrierSet |
createBarrierSet(jdk.vm.ci.meta.MetaAccessProvider metaAccess)
Returns a suitable
BarrierSet for the garbage collector that is used for this heap. |
void |
detachThread(org.graalvm.nativeimage.IsolateThread isolateThread)
Notifies the heap that a thread will be detached from the VM.
|
void |
endSafepoint()
Reset the heap to the normal execution state.
|
HeapAccounting |
getAccounting() |
protected List<Class<?>> |
getAllClasses()
Get all known classes.
|
Reference<?> |
getAndClearReferencePendingList()
Atomically get the list of pending references and clears (resets) it.
|
int |
getClassCount()
Returns the number of classes in the heap (initialized as well as uninitialized).
|
org.graalvm.word.UnsignedWord |
getCommittedBytes() |
GC |
getGC() |
static HeapImpl |
getHeapImpl() |
static ImageHeapInfo |
getImageHeapInfo() |
int |
getImageHeapNullRegionSize()
Returns the number of null bytes that should be prepended to the image heap during the image
build.
|
int |
getImageHeapOffsetInAddressSpace()
Returns an offset relative to the heap base, at which the image heap should be mapped into
the address space.
|
ObjectHeader |
getObjectHeader()
Get the ObjectHeader implementation that this Heap uses.
|
OldGeneration |
getOldGeneration() |
int |
getPreferredAddressSpaceAlignment()
Returns a multiple to which the heap address space should be aligned to at runtime.
|
RuntimeCodeInfoGCSupport |
getRuntimeCodeInfoGCSupport() |
org.graalvm.word.UnsignedWord |
getUsedBytes() |
YoungGeneration |
getYoungGeneration() |
boolean |
hasReferencePendingList()
|
boolean |
isAllocationDisallowed() |
boolean |
isInImageHeap(Object obj)
Returns true if the given object is located in the image heap.
|
boolean |
isInImageHeap(org.graalvm.word.Pointer objPointer)
Returns true if the object at the given address is located in the image heap.
|
boolean |
isInPrimaryImageHeap(Object obj)
Whether the object is in the primary image heap, as opposed to an auxiliary image heap.
|
boolean |
isInPrimaryImageHeap(org.graalvm.word.Pointer objPointer)
Whether the object is in the primary image heap, as opposed to an auxiliary image heap.
|
void |
optionValueChanged(RuntimeOptionKey<?> key)
Notify the GC that the value of a GC-relevant option changed.
|
void |
prepareForSafepoint()
Prepare the heap for a safepoint.
|
boolean |
printLocationInfo(Log log,
org.graalvm.word.UnsignedWord value,
boolean allowJavaHeapAccess,
boolean allowUnsafeOperations)
If the passed value is within the Java heap, this method prints some information about that
value and returns true.
|
void |
resumeAllocation() |
void |
suspendAllocation() |
boolean |
tearDown()
Tear down the heap and release its memory.
|
static boolean |
usesImageHeapCardMarking() |
static boolean |
usesImageHeapChunks() |
void |
waitForReferencePendingList()
Blocks until the heap has pending references.
|
void |
wakeUpReferencePendingListWaiters()
Unblocks any threads in
Heap.waitForReferencePendingList(). |
boolean |
walkCollectedHeapObjects(ObjectVisitor visitor)
Walk all heap objects except the native image heap objects.
|
boolean |
walkImageHeapObjects(ObjectVisitor visitor)
Walk all native image heap objects.
|
boolean |
walkObjects(ObjectVisitor visitor)
Walk all the objects in the heap.
|
getHeap, getLoadedClassespublic static HeapImpl getHeapImpl()
public static ImageHeapInfo getImageHeapInfo()
public boolean isInImageHeap(Object obj)
HeapisInImageHeap in class Heappublic boolean isInImageHeap(org.graalvm.word.Pointer objPointer)
HeapisInImageHeap in class Heappublic boolean isInPrimaryImageHeap(Object obj)
HeapisInPrimaryImageHeap in class Heappublic boolean isInPrimaryImageHeap(org.graalvm.word.Pointer objPointer)
HeapisInPrimaryImageHeap in class Heappublic void suspendAllocation()
suspendAllocation in class Heappublic void resumeAllocation()
resumeAllocation in class Heappublic boolean walkObjects(ObjectVisitor visitor)
HeapwalkObjects in class Heappublic boolean tearDown()
public ObjectHeader getObjectHeader()
HeapgetObjectHeader in class Heappublic RuntimeCodeInfoGCSupport getRuntimeCodeInfoGCSupport()
getRuntimeCodeInfoGCSupport in class Heappublic HeapAccounting getAccounting()
public boolean isAllocationDisallowed()
isAllocationDisallowed in class Heappublic YoungGeneration getYoungGeneration()
public OldGeneration getOldGeneration()
public org.graalvm.word.UnsignedWord getUsedBytes()
public org.graalvm.word.UnsignedWord getCommittedBytes()
public int getClassCount()
HeapgetClassCount in class Heapprotected List<Class<?>> getAllClasses()
HeapPredefinedClassesSupport.getAllClasses in class Heappublic void prepareForSafepoint()
HeapprepareForSafepoint in class Heappublic void endSafepoint()
HeapendSafepoint in class Heappublic void attachThread(org.graalvm.nativeimage.IsolateThread isolateThread)
HeapattachThread in class Heappublic void detachThread(org.graalvm.nativeimage.IsolateThread isolateThread)
HeapdetachThread in class Heappublic static boolean usesImageHeapChunks()
public static boolean usesImageHeapCardMarking()
public int getPreferredAddressSpaceAlignment()
HeapgetPreferredAddressSpaceAlignment in class HeapCommittedMemoryProvider.guaranteesHeapPreferredAddressSpaceAlignment()public int getImageHeapOffsetInAddressSpace()
HeapgetImageHeapOffsetInAddressSpace in class Heappublic int getImageHeapNullRegionSize()
HeapImageHeapProvider for more details).getImageHeapNullRegionSize in class Heappublic boolean walkImageHeapObjects(ObjectVisitor visitor)
HeapwalkImageHeapObjects in class Heappublic boolean walkCollectedHeapObjects(ObjectVisitor visitor)
HeapwalkCollectedHeapObjects in class Heappublic org.graalvm.compiler.nodes.gc.BarrierSet createBarrierSet(jdk.vm.ci.meta.MetaAccessProvider metaAccess)
HeapBarrierSet for the garbage collector that is used for this heap.createBarrierSet in class Heappublic boolean hasReferencePendingList()
HeaphasReferencePendingList in class Heappublic void waitForReferencePendingList()
throws InterruptedException
HeapwaitForReferencePendingList in class HeapInterruptedExceptionpublic void wakeUpReferencePendingListWaiters()
HeapHeap.waitForReferencePendingList().wakeUpReferencePendingListWaiters in class Heappublic Reference<?> getAndClearReferencePendingList()
Heapnull.getAndClearReferencePendingList in class Heappublic boolean printLocationInfo(Log log, org.graalvm.word.UnsignedWord value, boolean allowJavaHeapAccess, boolean allowUnsafeOperations)
HeapprintLocationInfo in class Heappublic void optionValueChanged(RuntimeOptionKey<?> key)
HeapoptionValueChanged in class Heap