javax.realtime
Class ImmortalMemory

java.lang.Object
  extended byjavax.realtime.MemoryArea
      extended byjavax.realtime.ImmortalMemory

public final class ImmortalMemory
extends MemoryArea

ImmortalMemory is a memory resource that is shared among all threads. Objects allocated in the immortal memory live until the end of the application. Objects in immortal memory are never subject to garbage collection, although some GC algorithms may require a scan of the immortal memory. An immortal object may only contain reference to other immortal objects or to heap objects. Unlike standard Java heap objects, immortal objects continue to exist even after there are no other references to them.

Author:
Angelo Corsaro

Field Summary
 
Fields inherited from class javax.realtime.MemoryArea
logic, parent, sizeInBytes
 
Method Summary
protected  void fini()
           
protected  void init()
           
static ImmortalMemory instance()
          Returns a reference to the singleton ImmortalMemory space.
 long memoryConsumed()
          An exact count, in bytes, of the all of the memory currently used by the system for the allocated objects.
 long memoryRemaining()
          An approximation to the total amount of memory currently available for future allocated objects, measured in bytes.
 
Methods inherited from class javax.realtime.MemoryArea
enter, enter, executeInArea, finalize, getMemoryArea, guardedRun, 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 ImmortalMemory instance()
Returns a reference to the singleton ImmortalMemory space.

Returns:
The singleton ImmortalMemory object.

memoryConsumed

public long memoryConsumed()
An exact count, in bytes, of the all of the memory currently used by the system for the allocated objects.

Specified by:
memoryConsumed in class MemoryArea
Returns:
The amount of memory consumed in bytes.

memoryRemaining

public long memoryRemaining()
An approximation to the total amount of memory currently available for future allocated objects, measured in bytes.

Specified by:
memoryRemaining in class MemoryArea
Returns:
The amount of remaining memory in bytes.

init

protected void init()
Specified by:
init in class MemoryArea

fini

protected void fini()
Specified by:
fini in class MemoryArea


jRate is developed and maintained by the jRate project development team.
Copyright (c) 2001-2005 Angelo Corsaro and Morgan Deters.