public class VTMemory extends ScopedMemory
A memory area of this type is does not give a guarantee on the allocation time. However, in JamaicaVM, VTMemory behaves exactly as LTMemory, i.e, it 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 VTMemory 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 a VTMemory may fail if the available memory on the Java heap is low.
memoryAreaHeapLock
Constructor and Description |
---|
VTMemory(long size)
Constructor to create an instance of VTMemory with the given
size.
|
VTMemory(long initialSizeInBytes,
long maxSizeInBytes)
Constructor to create an instance of VTMemory with the given
initial and maximum size.
|
VTMemory(long initialSizeInBytes,
long maxSizeInBytes,
Runnable logic)
Constructor to create an instance of VTMemory with the given
initial and maximum size and default logic.
|
VTMemory(long size,
Runnable logic)
Constructor to create an instance of VTMemory with the given
size and default logic.
|
VTMemory(SizeEstimator size)
Constructor to create an instance of VTMemory with the given
size.
|
VTMemory(SizeEstimator size,
Runnable logic)
Constructor to create an instance of VTMemory with the given
size and default logic.
|
VTMemory(SizeEstimator initial,
SizeEstimator maximum)
Constructor to create an instance of VTMemory with the given
initial and maximum size.
|
VTMemory(SizeEstimator initial,
SizeEstimator maximum,
Runnable logic)
Constructor to create an instance of VTMemory with the given
initial and maximum size and default logic.
|
Modifier and Type | Method and Description |
---|---|
String |
toString()
toString creates a string representation of this memory area of
the form "(VTMemory) 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 VTMemory(long initialSizeInBytes, long maxSizeInBytes)
Constructor to create an instance of VTMemory with the given initial and maximum size.
In JamaicaVM, the size of an VTMemory is not increased dynamically. If the initial size is less than maxSizeInBytes, it will be set to maxSizeInBytes.
IllegalArgumentException
- if initialSizeInBytes >
maxSizeInBytes or initialSizeInBytes < 0 or maxSizeInBytes < 0.OutOfMemoryError
- if there is insufficient free memory on
the heap.initialSizeInBytes
- The initial size of the memory area in
bytes.maxSizeInBytes
- The maximum size of the memory area in
bytes.public VTMemory(long initialSizeInBytes, long maxSizeInBytes, Runnable logic)
Constructor to create an instance of VTMemory with the given initial and maximum size and default logic.
In JamaicaVM, the size of an VTMemory is not increased dynamically. If the initial size is less than maxSizeInBytes, it will be set to maxSizeInBytes.
IllegalArgumentException
- if initialSizeInBytes >
maxSizeInBytes or initialSizeInBytes < 0 or maxSizeInBytes < 0.OutOfMemoryError
- if there is insufficient free memory on
the heap.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().public VTMemory(SizeEstimator initial, SizeEstimator maximum)
Constructor to create an instance of VTMemory with the given initial and maximum size.
In JamaicaVM, the size of an VTMemory is not increased dynamically. If the initial size is less than maxSizeInBytes, it will be set to maxSizeInBytes.
IllegalArgumentException
- if initial or maximum is null or
initial.getEstimate() < max.getEstimate().OutOfMemoryError
- if there is insufficient free memory on
the heap.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.public VTMemory(SizeEstimator initial, SizeEstimator maximum, Runnable logic)
Constructor to create an instance of VTMemory with the given initial and maximum size and default logic.
In JamaicaVM, the size of an VTMemory is not increased dynamically. If the initial size is less than maxSizeInBytes, it will be set to maxSizeInBytes.
IllegalArgumentException
- if initial or maximum is null or
initial.getEstimate() > max.getEstimate().OutOfMemoryError
- if there is insufficient free memory on
the heap.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().public VTMemory(long size)
Constructor to create an instance of VTMemory with the given size.
size
- The size of the memory area in bytes.public VTMemory(long size, Runnable logic)
Constructor to create an instance of VTMemory 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 VTMemory(SizeEstimator size)
Constructor to create an instance of VTMemory with the given size.
size
- an instance of SizeEstimator that determines the size.public VTMemory(SizeEstimator size, Runnable logic)
Constructor to create an instance of VTMemory 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 String toString()
toString
in class ScopedMemory
aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2016 aicas GmbH. All Rights Reserved.