public class LTMemory extends ScopedMemory
LTMemory represents a memory area guaranteed by the system to have
linear time allocation when memory consumption from the memory area is less
than the memory area's initial size. Execution time for allocation
is allowed to vary when memory consumption is between the initial size and
the maximum size for the area. Furthermore, the underlying system is not
required to guarantee that memory between initial and maximum will always be
available.
The memory area described by a LTMemory instance does not exist in
the Java heap, and is not subject to garbage collection. Thus, it is safe to
use a LTMemory object as the initial memory area for a
Schedulable instance which may not use the
HeapMemory or to enter the memory area using the
ScopedMemory.enter() method within such an instance.
Enough memory must be committed by the completion of the constructor to
satisfy the initial memory requirement. (Committed means that this memory
must always be available for allocation). The initial memory allocation must
behave, with respect to successful allocation, as if it were contiguous;
i.e., a correct implementation must guarantee that any sequence of object
allocations that could ever succeed without exceeding a specified initial
memory size will always succeed without exceeding that initial memory size
and succeed for any instance of LTMemory with that initial memory
size.
Creation of an LTMemory shall fail with an
StaticOutOfMemoryError when the current
Schedulable has been configured with a
ScopedMemoryParameters.getMaxGlobalBackingStore() that would be exceeded by
said creation.
Note, to ensure that all requested memory is available set initial and maximum to the same value.
Methods from LTMemory should be overridden only by methods that use
super.
| Constructor and Description |
|---|
LTMemory(long size)
Equivalent to
LTMemory(long, Runnable) with the argument list
((size, null). |
LTMemory(long size,
Runnable logic)
Create a scoped memory of the given size and with the give logic to
run upon entry when no other logic is given.
|
LTMemory(SizeEstimator size)
Equivalent to
LTMemory(long, Runnable) with argument list
(size.getEstimate(), null). |
LTMemory(SizeEstimator size,
Runnable logic)
Equivalent to
LTMemory(long, Runnable) with argument list
(size.getEstimate(), runnable). |
enter, enter, enter, enter, enter, enter, enter, executeInArea, executeInArea, executeInArea, executeInArea, executeInArea, executeInArea, getParent, getPortal, getReferenceCount, globalBackingStoreConsumed, globalBackingStoreRemaining, globalBackingStoreSize, join, join, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnterInternal, joinAndEnterInternal, joinAndEnterInternal, joinAndEnterInternal, joinAndEnterInternal, mayHoldReferenceTo, mayHoldReferenceTo, setPortal, toStringgetMemoryArea, memoryConsumed, memoryRemaining, newArray, newArrayInArea, newInstance, newInstance, sizepublic LTMemory(long size)
LTMemory(long, Runnable) with the argument list
((size, null).IllegalArgumentException - when size is less than zero.StaticOutOfMemoryError - when there is insufficient memory for
the LTMemory object or for
the backing memory, or when the
current Schedulable would
exceed its configured allowance of
global backing store.UnsupportedOperationException - In JamaicaVM when a user-defined
subclass does not know about the
memory area implementation details.size - The size in bytes of the memory to allocate for this area. This
memory must be committed before the completion of the
constructor.public LTMemory(long size,
Runnable logic)
IllegalArgumentException - when size is less than zero.StaticOutOfMemoryError - when there is insufficient memory for
the LTMemory object or for
the backing memory, or when the
current Schedulable would
exceed its configured allowance of
global backing store.IllegalAssignmentError - when storing logic in this would violate the assignment
rules.UnsupportedOperationException - In JamaicaVM when a user-defined
subclass does not know about the
memory area implementation details.size - The size in bytes of the memory to allocate for this area.
This memory must be committed before the completion of the
constructor.logic - The run() of the given Runnable will be
executed using this as its initial memory area. When
logic is null, this constructor is equivalent
to LTMemory(long).public LTMemory(SizeEstimator size)
LTMemory(long, Runnable) with argument list
(size.getEstimate(), null).IllegalArgumentException - when size is null.StaticOutOfMemoryError - when there is insufficient memory for
the LTMemory object or for
the backing memory, or when the
current Schedulable would
exceed its configured allowance of
global backing store.UnsupportedOperationException - In JamaicaVM when a user-defined
subclass does not know about the
memory area implementation details.size - An instance of SizeEstimator used to
give an estimate of the initial size. This memory must be
committed before the completion of the constructor.public LTMemory(SizeEstimator size, Runnable logic)
LTMemory(long, Runnable) with argument list
(size.getEstimate(), runnable).IllegalArgumentException - when size is null.StaticOutOfMemoryError - when there is insufficient memory for
the LTMemory object or for
the backing memory, or when the
current Schedulable would
exceed its configured allowance of
global backing store.IllegalAssignmentError - when storing logic in this would violate the assignment
rules.UnsupportedOperationException - In JamaicaVM when a user-defined
subclass does not know about the
memory area implementation details.size - An instance of SizeEstimator used to
give an estimate of the initial size. This memory must be
committed before the completion of the constructor.logic - The run() of the given Runnable will be
executed using this as its initial memory area. When
logic is null, this constructor is equivalent
to LTMemory(SizeEstimator).aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2021 aicas GmbH. All Rights Reserved.