|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectpatterntesting.runtime.monitor.MemoryGuard
public final class MemoryGuard
The Class MemoryGuard.
| Method Summary | |
|---|---|
static long |
getFreeMemory()
Gets the free memory. |
static String |
getFreeMemoryAsString()
Gets the free memory as string. |
static int |
getFreeMemoryInPercent()
Gets the free memory in percent. |
static String |
getMemoryLogMessage()
Gets the memory log message. |
static void |
logFreeMemory(long interval)
Every x milliseconds the free memory is checked and printed into the log (according the log level). |
static void |
logMemory()
Log memory. |
static void |
logMemory(org.slf4j.Logger lg)
Logs a message if free memory falls down below x% of maximal heap size where x is: x < 1%: logs a fatal message 1% <= x < 2%: logs an error 1% <= x < 10%: logs a warning 10% <= x < 20%: logs an info message 20% <= x < 50%: logs debug message x >= 50%: tracing . |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static long getFreeMemory()
public static int getFreeMemoryInPercent()
public static String getFreeMemoryAsString()
public static void logMemory()
logMemory(Logger)public static void logMemory(org.slf4j.Logger lg)
lg - the logpublic static String getMemoryLogMessage()
public static void logFreeMemory(long interval)
throws InterruptedException
interval - (the sleep intervall in milliseconds, e.g. 300000 for 5 min.)
InterruptedException - the interrupted exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||