public final class ImmortalMemory extends PerennialMemory
ImmortalMemory is a memory resource that is
unexceptionally available to all schedulables and Java
threads for use and allocation.
An immortal object may not contain references to any form of
scoped memory, e.g., LTMemory,
StackedMemory, or
PinnableMemory.
Objects in immortal memory have the same states with respect to finalization as objects in the standard Java heap, but there is no assurance that immortal objects will be finalized even when the JVM is terminated.
Methods from ImmortalMemory should
be overridden only by methods that use super.
| Modifier and Type | Method and Description |
|---|---|
void |
executeInArea(java.lang.Runnable logic)
Executes the run method from the
logic parameter using this
memory area as the current allocation context. |
static ImmortalMemory |
instance()
Returns a pointer to the singleton
ImmortalMemory
object. |
enter, enter, enter, enter, enter, enter, enter, executeInArea, executeInArea, executeInArea, executeInArea, executeInArea, getMemoryArea, mayHoldReferenceTo, mayHoldReferenceTo, memoryConsumed, memoryRemaining, newArray, newArrayInArea, newInstance, newInstance, sizepublic static ImmortalMemory instance()
ImmortalMemory
object.ImmortalMemory object.public void executeInArea(java.lang.Runnable logic)
logic parameter using this
memory area as the current allocation context.
For a schedulable, this saves the current scope
stack and replaces it with one consisting only of
the ImmortalMemory instance;
restoring the original scope stack upon completion.executeInArea in class MemoryArealogic - The runnable object whose run() method should
be executed.StaticIllegalArgumentException - when logic is null.