Package mondrian.util
Class NotificationMemoryMonitor
java.lang.Object
mondrian.util.AbstractMemoryMonitor
mondrian.util.NotificationMemoryMonitor
- All Implemented Interfaces:
MemoryMonitor
,MemoryMonitor.Test
The
NotificationMemoryMonitor
class uses the Java5
memory management system to detect system low memory events.
This code is loosely based on the code taken from The Java Specialists' Newsletter, issue 92 authored by Dr. Heinz M. Kabutz. As a note, his on-line newletters are a good source of Java information, take a look.
For more information one should review the Java5 classes in java.lang.management.
- Since:
- Feb 03 2007
- Author:
- Richard M. Emberson
-
Nested Class Summary
Nested classes/interfaces inherited from interface mondrian.util.MemoryMonitor
MemoryMonitor.Listener, MemoryMonitor.Test
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.logging.log4j.Logger
Get theLogger
.long
Get the maximum possible memory usage for this JVM instance.long
Get the current memory usage for this JVM instance.protected void
notifyNewLowThreshold
(long newLowThreshold) Notify the Java5 memory management system that there is a new low threshold.Methods inherited from class mondrian.util.AbstractMemoryMonitor
addListener, addListener, convertPercentageToThreshold, convertThresholdToPercentage, generateLowThreshold, getDefaultThresholdPercentage, getLowThreshold, notifyListeners, removeAllListener, removeListener, resetFromTest, updateListenerThreshold, usagePercentage
-
Field Details
-
TENURED_POOL
-
-
Method Details
-
getLogger
protected org.apache.logging.log4j.Logger getLogger()Get theLogger
.- Specified by:
getLogger
in classAbstractMemoryMonitor
- Returns:
- the
Logger
.
-
notifyNewLowThreshold
protected void notifyNewLowThreshold(long newLowThreshold) Notify the Java5 memory management system that there is a new low threshold.- Overrides:
notifyNewLowThreshold
in classAbstractMemoryMonitor
- Parameters:
newLowThreshold
- the new threshold.
-
getMaxMemory
public long getMaxMemory()Get the maximum possible memory usage for this JVM instance.- Returns:
- maximum memory that can be used.
-
getUsedMemory
public long getUsedMemory()Get the current memory usage for this JVM instance.- Returns:
- current memory used.
-