Package mondrian.util
Class NotificationMemoryMonitor
- java.lang.Object
-
- mondrian.util.AbstractMemoryMonitor
-
- mondrian.util.NotificationMemoryMonitor
-
- All Implemented Interfaces:
MemoryMonitor
,MemoryMonitor.Test
public class NotificationMemoryMonitor extends AbstractMemoryMonitor
TheNotificationMemoryMonitor
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
Fields Modifier and Type Field Description protected static MemoryPoolMXBean
TENURED_POOL
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.logging.log4j.Logger
getLogger()
Get theLogger
.long
getMaxMemory()
Get the maximum possible memory usage for this JVM instance.long
getUsedMemory()
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 Detail
-
TENURED_POOL
protected static final MemoryPoolMXBean TENURED_POOL
-
-
Method Detail
-
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.
-
-