Package mondrian.util

Class NotificationMemoryMonitor

  • All Implemented Interfaces:
    MemoryMonitor, MemoryMonitor.Test

    public class NotificationMemoryMonitor
    extends AbstractMemoryMonitor
    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
    • Method Detail

      • getLogger

        protected org.apache.logging.log4j.Logger getLogger()
        Get the Logger.
        Specified by:
        getLogger in class AbstractMemoryMonitor
        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 class AbstractMemoryMonitor
        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.