public final class HeapMemory extends PerennialMemory
Heap memory represents the default allocation context for Java applications.
Modifier and Type | Method and Description |
---|---|
boolean |
executeInArea(BooleanSupplier logic)
Executes the
getAsBoolean() method from the logic
parameter using this memory area as the current allocation
context. |
double |
executeInArea(DoubleSupplier logic)
Executes the
getAsDouble() method from the logic parameter
using this memory area as the current allocation context. |
int |
executeInArea(IntSupplier logic)
Executes the
getAsInt() method from the logic parameter
using this memory area as the current allocation context. |
long |
executeInArea(LongSupplier logic)
Executes the
getAsLong() method from the logic parameter
using this memory area as the current allocation context. |
void |
executeInArea(Runnable logic)
Executes the
run() method from the logic parameter
using this memory area as the current allocation context. |
<T> T |
executeInArea(Supplier<T> logic)
Executes the
get() method from the logic parameter
using this memory area as the current allocation context. |
static HeapMemory |
instance()
instance returns the single instance of HeapMemory in the
system.
|
long |
memoryConsumed()
memoryConsumed returns the number of bytes of memory of this
memory area that have been consumed.
|
long |
memoryRemaining()
memoryRemaining returns the number of available bytes left in
this memory area.
|
enter, enter, enter, enter, enter, enter, enter, getMemoryArea, mayHoldReferenceTo, mayHoldReferenceTo, newArray, newArrayInArea, newInstance, newInstance, size
public static HeapMemory instance()
public long memoryRemaining()
memoryRemaining
in class MemoryArea
public long memoryConsumed()
memoryConsumed
in class MemoryArea
public void executeInArea(Runnable logic)
MemoryArea
run()
method from the logic
parameter
using this memory area as the current allocation context. The
effect of executeInArea
on the scope stack is specified in
the subclasses of MemoryArea
.executeInArea
in class MemoryArea
logic
- The logic whose run()
method is to be executed.public boolean executeInArea(BooleanSupplier logic)
MemoryArea
getAsBoolean()
method from the logic
parameter using this memory area as the current allocation
context. The effect of executeInArea
on the scope stack is
specified in the subclasses of MemoryArea
.executeInArea
in class MemoryArea
logic
- The logic whose getAsBoolean()
method is to be
executed.getAsBoolean()
method.public double executeInArea(DoubleSupplier logic)
MemoryArea
getAsDouble()
method from the logic
parameter
using this memory area as the current allocation context. The
effect of executeInArea
on the scope stack is specified in
the subclasses of MemoryArea
.executeInArea
in class MemoryArea
logic
- The logic whose getAsDouble()
method is to be
executed.getAsDouble()
method.public int executeInArea(IntSupplier logic)
MemoryArea
getAsInt()
method from the logic
parameter
using this memory area as the current allocation context. The
effect of executeInArea
on the scope stack is specified in
the subclasses of MemoryArea
.executeInArea
in class MemoryArea
logic
- The logic whose getAsInt()
method is to be executed.getAsInt()
method.public long executeInArea(LongSupplier logic)
MemoryArea
getAsLong()
method from the logic
parameter
using this memory area as the current allocation context. The
effect of executeInArea
on the scope stack is specified in
the subclasses of MemoryArea
.executeInArea
in class MemoryArea
logic
- The logic whose getAsLong()
method is to be executed.getAsLong()
method.public <T> T executeInArea(Supplier<T> logic)
MemoryArea
get()
method from the logic
parameter
using this memory area as the current allocation context. The
effect of executeInArea
on the scope stack is specified in
the subclasses of MemoryArea
.executeInArea
in class MemoryArea
logic
- The logic whose get()
method is to be executed.get()
method.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2025 aicas GmbH. All Rights Reserved.