|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.realtime.MemoryArea | +--javax.realtime.HeapMemory
The HeapMemory
class is a singleton object that allows logic
within other scoped memory to allocate objects in the Java heap.
Field Summary | |
private static javax.realtime.HeapMemory |
theHeap
The one and only HeapMemory. |
Fields inherited from class javax.realtime.MemoryArea |
constant, heap, id, logic, memoryConsumed, nullClassArr, nullMem, nullObjArr, scoped, shadow, size |
Constructor Summary | |
private |
HeapMemory()
|
Method Summary | |
void |
checkNoHeap()
Check to make sure that we're not in a NoHeapRealtimeThread. |
protected void |
initNative(long sizeInBytes)
Initialize the native component of the HeapMemory. |
static javax.realtime.HeapMemory |
instance()
Return a pointer to the singleton instace of HeapMemory
representing the Java heap. |
long |
memoryConsumed()
Indicates the amount of memory currently allocated in the Java heap. |
long |
memoryRemaining()
Indicates the free memory remaining in the Java heap. |
java.lang.Object |
newArray(java.lang.Class type,
int number)
Create a new array, checking to make sure that we're not in a NoHeapRealtimeThread. |
java.lang.Object |
newArray(java.lang.Class type,
int[] dimensions)
Create a new multi-dimensional array, checking to make sure that we're not in a NoHeapRealtimeThread. |
java.lang.Object |
newInstance(java.lang.Class type)
Create a new object, checking to make sure that we're not in a NoHeapRealtimeThread. |
java.lang.Object |
newInstance(java.lang.Class type,
java.lang.Class[] parameterTypes,
java.lang.Object[] parameters)
Create a new object, checking to make sure that we're not in a NoHeapRealtimeThread. |
java.lang.String |
toString()
Print a helpful string describing this HeapMemory. |
Methods inherited from class javax.realtime.MemoryArea |
bless, checkAccess, checkNewInstance, enter, enter, enterMemBlock, executeInArea, exitMemBlock, getMemoryArea, getOuterScope, newArray, newArray, newInstance, newInstance, postSetup, preSetup, registerFinal, shadow, size, startMem, stopMem, throwIllegalAssignmentError |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static javax.realtime.HeapMemory theHeap
Constructor Detail |
private HeapMemory()
Method Detail |
public static javax.realtime.HeapMemory instance()
HeapMemory
representing the Java heap.
HeapMemory
object.public long memoryConsumed()
memoryConsumed
in class MemoryArea
public long memoryRemaining()
memoryRemaining
in class MemoryArea
protected void initNative(long sizeInBytes)
initNative
in class MemoryArea
public java.lang.String toString()
toString
in class MemoryArea
public java.lang.Object newArray(java.lang.Class type, int number) throws java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.OutOfMemoryError
newArray
in class MemoryArea
type
- The class of the elements of the new array.number
- The number of elements in the new array.
java.lang.OutOfMemoryError
- Space in the memory area is exhaused.
java.lang.InstantiationException
- The array cannot be instantiated.
java.lang.IllegalAccessException
- The class or initializer is
inaccessible.public java.lang.Object newArray(java.lang.Class type, int[] dimensions) throws java.lang.IllegalAccessException, java.lang.OutOfMemoryError
newArray
in class MemoryArea
java.lang.IllegalAccessException
java.lang.OutOfMemoryError
public java.lang.Object newInstance(java.lang.Class type, java.lang.Class[] parameterTypes, java.lang.Object[] parameters) throws java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.OutOfMemoryError
newInstance
in class MemoryArea
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.OutOfMemoryError
public java.lang.Object newInstance(java.lang.Class type) throws java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.OutOfMemoryError
newInstance
in class MemoryArea
type
- The class of which to create a new instance.
java.lang.OutOfMemoryError
- Space in the memory area is exhaused.
java.lang.IllegalAccessException
- The class or initializer is
inaccessible.
java.lang.InstantiationException
- The specified class object
could not be instantiated.
Possible causes are: it is an
interface; it is abstract; it
is an array, or an exception
was thrown by the constructor.public void checkNoHeap()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |