Class MemoryUsageMonitor.MemoryUsage

java.lang.Object
org.jivesoftware.util.MemoryUsageMonitor.MemoryUsage
Enclosing class:
MemoryUsageMonitor

@Immutable public static class MemoryUsageMonitor.MemoryUsage extends Object
Memory usage statistics.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    MemoryUsage(double usedMemory, double totalMemory, double maximumMemory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a snapshot of the current memory usage.
    double
    Returns the maximum amount of memory available to Openfire, including used, free and as-of-yet unallocated memory, in megabytes.
    int
    Returns the percentage of the maximum memory that is currently used by Openfire, rounded to the nearest integer value.
    double
    Returns the percentage of the maximum memory that is currently being used by Openfire.
    double
    Returns the total amount of memory available to Openfire, including used and free memory, in megabytes.
    double
    Returns the amount of memory currently used by Openfire (memory populated with objects), in megabytes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MemoryUsage

      protected MemoryUsage(double usedMemory, double totalMemory, double maximumMemory)
  • Method Details

    • createSnapshot

      @Nonnull public static MemoryUsageMonitor.MemoryUsage createSnapshot()
      Creates a snapshot of the current memory usage.
      Returns:
      memory usage statistics
    • getUsedMemory

      public double getUsedMemory()
      Returns the amount of memory currently used by Openfire (memory populated with objects), in megabytes.
      Returns:
      total amount of memory used by Openfire, in megabytes.
    • getTotalMemory

      public double getTotalMemory()
      Returns the total amount of memory available to Openfire, including used and free memory, in megabytes. This value is equivalent to the amount of committed memory in the Java process.
      Returns:
      total amount of memory available to Openfire, in megabytes.
    • getMaximumMemory

      public double getMaximumMemory()
      Returns the maximum amount of memory available to Openfire, including used, free and as-of-yet unallocated memory, in megabytes. This value is equivalent to the amount of memory available to the Java process as configured with the -Xmx value.
      Returns:
      maximum amount of memory available to Openfire, in megabytes.
    • getPercentUsed

      public double getPercentUsed()
      Returns the percentage of the maximum memory that is currently being used by Openfire.
      Returns:
      a percentage (between 0.0 and 100.0).
    • getPercent

      public int getPercent()
      Returns the percentage of the maximum memory that is currently used by Openfire, rounded to the nearest integer value.
      Returns:
      a percentage (between 0 and 100).