aicas logoJamaica 6.1 release 1

javax.realtime
Class HeapMemory

java.lang.Object
  extended by javax.realtime.MemoryArea
      extended by javax.realtime.HeapMemory

public final class HeapMemory
extends MemoryArea

Jamaica Real-Time Specification for Java class HeapMemory.

Heap memory represents the default allocation context for Java applications.


Method Summary
static HeapMemory instance()
          instance returns the single instance of HeapMemory in the system.
 long memoryConsumed()
          memoryConsumed returns the number of bytes of memory of this memory area that have been consumed.
 long memoryRemaining()
          memoryRemaining returns the number of available bytes left in this memory area.
 
Methods inherited from class javax.realtime.MemoryArea
enter, enter, executeInArea, finalize, getMemoryArea, newArray, newInstance, newInstance, size
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static HeapMemory instance()
instance returns the single instance of HeapMemory in the system.

Returns:
the single instance of heap memory.

memoryRemaining

public long memoryRemaining()
memoryRemaining returns the number of available bytes left in this memory area. This may be an estimation of the amount of available memory. In JamaicaVM, memoryRemaining for HeapMemory is the total heap memory minus memoryConsumed().

Overrides:
memoryRemaining in class MemoryArea
Returns:
the number of free bytes in this memory area.

memoryConsumed

public long memoryConsumed()
memoryConsumed returns the number of bytes of memory of this memory area that have been consumed. For memory areas that are freed explicitly by the user (e.g. by exiting a scoped memory area), the result is exact. For other memory areas (that may be under the control of the garbage collector), the result may be an estimation. In JamaicaVM, the memoryConsumed() for HeapMemory is the amount of allocated (i.e. non-free) memory. It is an upper bound for the amount of reachable memory.

Overrides:
memoryConsumed in class MemoryArea
Returns:
number of bytes consumed from this memory area.

aicas logoJamaica 6.1 release 1

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