public class LTMemory extends ScopedMemory
Jamaica Real-Time Specification for Java class LTMemory.
A memory area of this type is guaranteed to have allocation time linear in the size of the allocation.
The memory allocated in this memory area is not subject to garbage collection. It is hence safe to access this memory from within a NoHeapRealtimeThread or an AsyncBaseEventHandler with no-heap set to true.
In JamaicaVM, the actual size will never be increased dynamically, i.e., it remains at the initial value.
In JamaicaVM, the memory space for this LTMemory area is allocated from the normal Java heap (HeapMemory), i.e., it is not depending on an external memory source such as a call to the C function malloc(). This implies that the creation of an LTMemory may fail if the available memory on the Java heap is low.
memoryAreaHeapLock
Constructor and Description |
---|
LTMemory(long size)
Constructor to create an instance of LTMemory with the given
size.
|
LTMemory(long initialSizeInBytes,
long maxSizeInBytes)
Constructor to create an instance of LTMemory with the given
initial and maximum size.
|
LTMemory(long initialSizeInBytes,
long maxSizeInBytes,
java.lang.Runnable logic)
Constructor to create an instance of LTMemory with the given
initial and maximum size and default logic.
|
LTMemory(long size,
java.lang.Runnable logic)
Constructor to create an instance of LTMemory with the given
size and default logic.
|
LTMemory(SizeEstimator size)
Constructor to create an instance of LTMemory with the given
size.
|
LTMemory(SizeEstimator size,
java.lang.Runnable logic)
Constructor to create an instance of LTMemory with the given
size and default logic.
|
LTMemory(SizeEstimator initial,
SizeEstimator maximum)
Constructor to create an instance of LTMemory with the given
initial and maximum size.
|
LTMemory(SizeEstimator initial,
SizeEstimator maximum,
java.lang.Runnable logic)
Constructor to create an instance of LTMemory with the given
initial and maximum size and default logic.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
toString()
toString creates a string representation of this memory area of
the form "(LTMemory) Scoped memory # " + num with num being a unique
identifier for this memory area.
|
enter, enter, executeInArea, getMaximumSize, getParent, getPortal, getReferenceCount, join, join, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, setPortal
clearMemory, createStackedMemory, freeStacked, getMemoryArea, memoryConsumed, memoryNeedsToBeCleared, memoryNeedsToBeFreed, memoryRemaining, newArray, newInstance, newInstance, size
public LTMemory(long initialSizeInBytes, long maxSizeInBytes)
Constructor to create an instance of LTMemory with the given initial and maximum size.
In JamaicaVM, the size of an LTMemory is not increased dynamically. If the initial size is less than maxSizeInBytes, it will be set to maxSizeInBytes.
initialSizeInBytes
- The initial size of the memory area in
bytes.maxSizeInBytes
- The maximum size of the memory area in
bytes.java.lang.IllegalArgumentException
- if initialSizeInBytes >
maxSizeInBytes or initialSizeInBytes < 0 or maxSizeInBytes < 0.java.lang.OutOfMemoryError
- if there is insufficient free memory on
the heap.public LTMemory(long initialSizeInBytes, long maxSizeInBytes, java.lang.Runnable logic)
Constructor to create an instance of LTMemory with the given initial and maximum size and default logic.
In JamaicaVM, the size of an LTMemory is not increased dynamically. If the initial size is less than maxSizeInBytes, it will be set to maxSizeInBytes.
initialSizeInBytes
- The initial size of the memory area in
bytes.maxSizeInBytes
- The maximum size of the memory area in
bytes.logic
- The default logic to be executed on a call to
enter().java.lang.IllegalArgumentException
- if initialSizeInBytes >
maxSizeInBytes or initialSizeInBytes < 0 or maxSizeInBytes < 0.java.lang.OutOfMemoryError
- if there is insufficient free memory on
the heap.public LTMemory(SizeEstimator initial, SizeEstimator maximum)
Constructor to create an instance of LTMemory with the given initial and maximum size.
In JamaicaVM, the size of an LTMemory is not increased dynamically. If the initial size is less than maxSizeInBytes, it will be set to maxSizeInBytes.
initial
- An instance of SizeEstimator that determines the
initial size of the memory area.maximum
- An instance of SizeEstimator that determines the
maximum size of the memory area.java.lang.IllegalArgumentException
- if initial or maximum is null or
initial.getEstimate() > max.getEstimate().java.lang.OutOfMemoryError
- if there is insufficient free memory on
the heap.public LTMemory(SizeEstimator initial, SizeEstimator maximum, java.lang.Runnable logic)
Constructor to create an instance of LTMemory with the given initial and maximum size and default logic.
In JamaicaVM, the size of an LTMemory is not increased dynamically. If the initial size is less than maxSizeInBytes, it will be set to maxSizeInBytes.
initial
- An instance of SizeEstimator that
determines the initial size of the memory area.maximum
- An instance of SizeEstimator that
determines the maximum size of the memory area.logic
- The default logic to be executed on a call to
enter().java.lang.IllegalArgumentException
- if initial or maximum is null or
initial.getEstimate() > max.getEstimate().java.lang.OutOfMemoryError
- if there is insufficient free memory on
the heap.public LTMemory(long size)
Constructor to create an instance of LTMemory with the given size.
size
- The size of the memory area in bytes.public LTMemory(long size, java.lang.Runnable logic)
Constructor to create an instance of LTMemory with the given size and default logic.
size
- The size of the memory area in bytes.logic
- The default logic to be executed on a call to
enter().public LTMemory(SizeEstimator size)
Constructor to create an instance of LTMemory with the given size.
size
- An instance of SizeEstimator that determines the size.public LTMemory(SizeEstimator size, java.lang.Runnable logic)
Constructor to create an instance of LTMemory with the given size and default logic.
size
- An instance of SizeEstimator that determines the size.logic
- The default logic to be executed on a call to
enter().public java.lang.String toString()
toString
in class ScopedMemory
aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2016 aicas GmbH. All Rights Reserved.