|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.realtime.MemoryArea
javax.realtime.ScopedMemory
javax.realtime.VTMemory
public class VTMemory
Jamaica Real-Time Specification for Java class VTMemory.
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 AbstractAsyncEventHandler 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.
Field Summary |
---|
Fields inherited from class javax.realtime.MemoryArea |
---|
memoryAreaHeapLock |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class javax.realtime.ScopedMemory |
---|
enter, enter, executeInArea, getMaximumSize, getParent, getPortal, getReferenceCount, join, join, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, setPortal |
Methods inherited from class javax.realtime.MemoryArea |
---|
clearMemory, createStackedMemory, freeStacked, getMemoryArea, memoryConsumed, memoryNeedsToBeCleared, memoryNeedsToBeFreed, memoryRemaining, newArray, newInstance, newInstance, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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.
initialSizeInBytes
- The initial size of the memory area in
bytes.maxSizeInBytes
- The maximum size of the memory area in
bytes.
IllegalArgumentException
- if initialSizeInBytes >
maxSizeInBytes or initialSizeInBytes < 0 or maxSizeInBytes < 0.
OutOfMemoryError
- if there is insufficient free memory on
the heap.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.
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().
IllegalArgumentException
- if initialSizeInBytes >
maxSizeInBytes or initialSizeInBytes < 0 or maxSizeInBytes < 0.
OutOfMemoryError
- if there is insufficient free memory on
the heap.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.
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.
IllegalArgumentException
- if initial or maximum is null or
initial.getEstimate() > max.getEstimate().
OutOfMemoryError
- if there is insufficient free memory on
the heap.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.
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().
IllegalArgumentException
- if initial or maximum is null or
initial.getEstimate() > max.getEstimate().
OutOfMemoryError
- if there is insufficient free memory on
the heap.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().Method Detail |
---|
public String toString()
toString
in class ScopedMemory
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |