aicas logoJamaica 6.4 release 1

javax.realtime
Class LTMemory

java.lang.Object
  extended by javax.realtime.MemoryArea
      extended by javax.realtime.ScopedMemory
          extended by javax.realtime.LTMemory

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 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 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.


Field Summary
 
Fields inherited from class javax.realtime.MemoryArea
memoryAreaHeapLock
 
Constructor Summary
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, Runnable logic)
           Constructor to create an instance of LTMemory with the given initial and maximum size and default logic.
LTMemory(long size, 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, 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, Runnable logic)
           Constructor to create an instance of LTMemory 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 "(LTMemory) 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

LTMemory

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.

Parameters:
initialSizeInBytes - The initial size of the memory area in bytes.
maxSizeInBytes - The maximum size of the memory area in bytes.
Throws:
IllegalArgumentException - if initialSizeInBytes > maxSizeInBytes or initialSizeInBytes < 0 or maxSizeInBytes < 0.
OutOfMemoryError - if there is insufficient free memory on the heap.

LTMemory

public LTMemory(long initialSizeInBytes,
                long maxSizeInBytes,
                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.

Parameters:
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().
Throws:
IllegalArgumentException - if initialSizeInBytes > maxSizeInBytes or initialSizeInBytes < 0 or maxSizeInBytes < 0.
OutOfMemoryError - if there is insufficient free memory on the heap.

LTMemory

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.

Parameters:
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.
Throws:
IllegalArgumentException - if initial or maximum is null or initial.getEstimate() > max.getEstimate().
OutOfMemoryError - if there is insufficient free memory on the heap.

LTMemory

public LTMemory(SizeEstimator initial,
                SizeEstimator maximum,
                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.

Parameters:
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().
Throws:
IllegalArgumentException - if initial or maximum is null or initial.getEstimate() > max.getEstimate().
OutOfMemoryError - if there is insufficient free memory on the heap.

LTMemory

public LTMemory(long size)

Constructor to create an instance of LTMemory with the given size.

Parameters:
size - The size of the memory area in bytes.
Since:
RTSJ V1.0.1

LTMemory

public LTMemory(long size,
                Runnable logic)

Constructor to create an instance of LTMemory with the given size and default logic.

Parameters:
size - The size of the memory area in bytes.
logic - The default logic to be executed on a call to enter().
Since:
RTSJ V1.0.1

LTMemory

public LTMemory(SizeEstimator size)

Constructor to create an instance of LTMemory with the given size.

Parameters:
size - An instance of SizeEstimator that determines the size.
Since:
RTSJ V1.0.1

LTMemory

public LTMemory(SizeEstimator size,
                Runnable logic)

Constructor to create an instance of LTMemory with the given size and default logic.

Parameters:
size - An instance of SizeEstimator that determines the size.
logic - The default logic to be executed on a call to enter().
Since:
RTSJ V1.0.1
Method Detail

toString

public 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.

Overrides:
toString in class ScopedMemory
Returns:
a string representation of this.

aicas logoJamaica 6.4 release 1

aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2015 aicas GmbH. All Rights Reserved.