PAJES 3.0.21

org.pajes.html
Class PajeMemoryManager

java.lang.Object
  extended by java.lang.Thread
      extended by org.pajes.html.PajeMemoryManager
All Implemented Interfaces:
java.lang.Runnable

public class PajeMemoryManager
extends java.lang.Thread

The PajeMemoryManager is responsible for destroying Paje instances after they have been finished with, and can also intermittently suggest that the garbage collector should run.

PajeMemoryManager can be configured to call System.gc() at a minimum interval by having a <context-param> with a <param-name> of org.pajes.html.PajeMemoryManager.gcInterval. in the web application deployment descriptor. The a <param-value> of this parameter should be a positive integer to set the interval, or a negative integer to turn off forced garbage collection.

Note that the interval is a minimum interval: garbage collection is only suggested when a Paje is being destroyed and the minimum interval has elapsed.

The following example calls System.gc() at a minimum interval of 1 minute:

   <context-param>
       <param-name>org.pajes.html.PajeMemoryManager.gcInterval</param-name>
       <param-value>60000</param-value>
   </context-param>
 

The following example calls System.gc() every time a Paje is destroyed:

   <context-param>
       <param-name>org.pajes.html.PajeMemoryManager.gcInterval</param-name>
       <param-value>0</param-value>
   </context-param>
 

The following example turns off the calls to System.gc():

   <context-param>
       <param-name>org.pajes.html.PajeMemoryManager.gcInterval</param-name>
       <param-value>-1</param-value>
   </context-param>
 

Alternatively, the entire <context-param> could be removed to turn off garbage collection.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 void run()
          Monitors the queue, waiting for notification that a Paje has been finished with.
 void shutdown()
          Shuts down this PajeMemoryManager.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

run

public void run()
Monitors the queue, waiting for notification that a Paje has been finished with. When notified, all Pajes currently in the queue are processed.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

shutdown

public void shutdown()
Shuts down this PajeMemoryManager.


PAJES 3.0.21

Copyright © 1998-2007 Viridian Pty Limited. All Rights Reserved.