aicas logo Jamaica 3.4 release 8

com.aicas.jamaica.lang
Class MemoryReservationThread

java.lang.Object
  extended by java.lang.Thread
      extended by com.aicas.jamaica.lang.MemoryReservationThread
All Implemented Interfaces:
Runnable

public class MemoryReservationThread
extends Thread

The MemoryReservationThread is a low-priority thread that constantly reserves the amount of memory that was requested by the user to be reserved for allocation bursts.

This thread is started if the percentage is given, even if we are in -analyse mode. This ensures that the memory occupied by this thread will be taken into account in -analyse mode.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static int priority
          The priority of this thread.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MemoryReservationThread()
          Create the reservation thread and start it.
 
Method Summary
 void addAlarmHandler(AsyncEventHandler aeh)
          Add a handler that is fired whenever the amount of reserved memory reached 0.
static int minReservedMemory(boolean reset)
          minReservedMemory resturns the lowest value the amount of reserved memory has ever reached.
static int reservedMemory()
          reservedMemory returns the current amount of reserved memory.
static int reservedMemoryPercentage()
          Percentage of memory that is to be reserved.
 void run()
          Main GCThread run method.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, countStackFrames0, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

priority

public static final int priority
The priority of this thread. Set via property jamaica.reservation_thread_priority. Default value is 0.

Constructor Detail

MemoryReservationThread

public MemoryReservationThread()
Create the reservation thread and start it. This must only be called from the intializer of java.lang.System. If called later by the Java application, it will cause an IllegalStateException.

Method Detail

reservedMemoryPercentage

public static int reservedMemoryPercentage()
Percentage of memory that is to be reserved.


reservedMemory

public static int reservedMemory()
reservedMemory returns the current amount of reserved memory.

Returns:
the current amount of reserved memory, in number of blocks

minReservedMemory

public static int minReservedMemory(boolean reset)
minReservedMemory resturns the lowest value the amount of reserved memory has ever reached. If reset is true, then this minimum will be cleared.

Parameters:
reset - true to reset the amount of reserved memory, falso to leave the value unchanged.
Returns:
the lowest value the amount of reserved memory has been since program start or the last call to minReservedMemory(true). Result is given in number of blocks

run

public void run()
Main GCThread run method.

Specified by:
run in interface Runnable
Overrides:
run in class Thread

addAlarmHandler

public void addAlarmHandler(AsyncEventHandler aeh)
Add a handler that is fired whenever the amount of reserved memory reached 0. NOTE: This routine is currently not supported.


aicas logo Jamaica 3.4 release 8

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2009 aicas GmbH. All Rights Reserved.