public interface RmmEventHandler
Modifier and Type | Method and Description |
---|---|
long[] |
getAllocThresholds()
Get the memory thresholds that will trigger
onAllocThreshold(long)
to be called when one or more of the thresholds is crossed during a memory allocation. |
long[] |
getDeallocThresholds()
Get the memory thresholds that will trigger
onDeallocThreshold(long)
to be called when one or more of the thresholds is crossed during a memory deallocation. |
default void |
onAllocated(long size)
Invoked after every memory allocation when debug mode is enabled.
|
default boolean |
onAllocFailure(long sizeRequested)
Deprecated.
deprecated in favor of onAllocFailure(long, boolean)
|
default boolean |
onAllocFailure(long sizeRequested,
int retryCount)
Invoked on a memory allocation failure.
|
void |
onAllocThreshold(long totalAllocSize)
Invoked after an RMM memory allocate operation when an allocate threshold is crossed.
|
default void |
onDeallocated(long size)
Invoked after every memory deallocation when debug mode is enabled.
|
void |
onDeallocThreshold(long totalAllocSize)
Invoked after an RMM memory deallocation operation when a deallocate threshold is crossed.
|
default boolean onAllocFailure(long sizeRequested)
sizeRequested
- number of bytes that failed to allocatedefault void onAllocated(long size)
size
- number of bytes allocateddefault void onDeallocated(long size)
size
- number of bytes deallocateddefault boolean onAllocFailure(long sizeRequested, int retryCount)
sizeRequested
- number of bytes that failed to allocateretryCount
- number of times this allocation has been retried after failurelong[] getAllocThresholds()
onAllocThreshold(long)
to be called when one or more of the thresholds is crossed during a memory allocation.
A threshold is crossed when the total memory allocated before the RMM allocate operation
is less than a threshold value and the threshold value is less than or equal to the
total memory allocated after the RMM memory allocate operation.long[] getDeallocThresholds()
onDeallocThreshold(long)
to be called when one or more of the thresholds is crossed during a memory deallocation.
A threshold is crossed when the total memory allocated before the RMM deallocate operation
is greater than or equal to a threshold value and the threshold value is greater than the
total memory allocated after the RMM memory deallocate operation.void onAllocThreshold(long totalAllocSize)
getAllocThresholds()
for details on allocate threshold crossing.
NOTE: Any exception thrown by this method will cause the corresponding allocation that triggered the threshold callback to be released before the exception is propagated to the application.
totalAllocSize
- total amount of memory allocated after the crossingvoid onDeallocThreshold(long totalAllocSize)
getDeallocThresholds()
for details on deallocate threshold crossing.
NOTE: Any exception thrown by this method will be propagated to the application after the resource that triggered the threshold was released.
totalAllocSize
- total amount of memory allocated after the crossingCopyright © 2024. All rights reserved.