www.element4solution.com

e4s.util
Class E4MemoryWatchdog

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.util.E4MemoryWatchdog
All Implemented Interfaces:
java.lang.Runnable

public class E4MemoryWatchdog
extends E4Object
implements java.lang.Runnable

The Memory-Watchdog will be check in a certain intervall, if enought memory is free. Registered objects can be added using the AEP interface, and if free memory is below a specified trashold, then the registered object is kindly advised to give memory free.


Nested Class Summary
static interface E4MemoryWatchdog.AEP_MemoryFree
           
 
Field Summary
 
Fields inherited from class e4s.util.E4Object
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET
 
Method Summary
static java.lang.String _getSVNVersionString()
          Get version info string from subversion.
 void finalize()
           
static float freeMemoryPercentage()
          Get free memory.
static java.lang.String getHeapMemoryInfoString()
           
static java.lang.String getHeapMemoryInfoString(E4DecimalSign ds)
           
static java.lang.String getMemoryInfoString()
           
static java.lang.String getMemoryInfoString(E4DecimalSign ds)
           
static java.lang.String getPermGenMemoryInfoString()
           
static java.lang.String getPermGenMemoryInfoString(E4DecimalSign ds)
           
static java.lang.management.MemoryPoolMXBean getPermGenSpaceMXBean()
           
 E4MemoryWatchdog.AEP_MemoryFree[] getRegisteredInterfaces()
           
static void init()
           
static void log(java.lang.String txt)
           
static void register(E4MemoryWatchdog.AEP_MemoryFree free)
           
static void register(java.util.Hashtable hash, float trashhold)
           
static void register(java.util.Vector vec, float trashhold)
           
 void run()
           
 void stop()
           
static void stopAll()
           
 void unregister(E4MemoryWatchdog.AEP_MemoryFree free)
           
 
Methods inherited from class e4s.util.E4Object
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, toString, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

log

public static void log(java.lang.String txt)

init

public static void init()

finalize

public void finalize()
Overrides:
finalize in class E4Object

freeMemoryPercentage

public static float freeMemoryPercentage()
Get free memory.

Returns:
a value between 0.0f (no memory is free) and 1.0f (all memory is free).

getRegisteredInterfaces

public E4MemoryWatchdog.AEP_MemoryFree[] getRegisteredInterfaces()

unregister

public void unregister(E4MemoryWatchdog.AEP_MemoryFree free)

register

public static void register(java.util.Hashtable hash,
                            float trashhold)

register

public static void register(java.util.Vector vec,
                            float trashhold)

register

public static void register(E4MemoryWatchdog.AEP_MemoryFree free)

getMemoryInfoString

public static java.lang.String getMemoryInfoString()

getMemoryInfoString

public static java.lang.String getMemoryInfoString(E4DecimalSign ds)

getHeapMemoryInfoString

public static java.lang.String getHeapMemoryInfoString()

getHeapMemoryInfoString

public static java.lang.String getHeapMemoryInfoString(E4DecimalSign ds)

getPermGenMemoryInfoString

public static java.lang.String getPermGenMemoryInfoString()

getPermGenMemoryInfoString

public static java.lang.String getPermGenMemoryInfoString(E4DecimalSign ds)

getPermGenSpaceMXBean

public static java.lang.management.MemoryPoolMXBean getPermGenSpaceMXBean()

stop

public void stop()

stopAll

public static void stopAll()

_getSVNVersionString

public static java.lang.String _getSVNVersionString()
Get version info string from subversion.

Returns:
the version info string.
See Also:
E4Util.getRevisionCodeFromSVN(Class)

www.element4solution.com