Class MemoryUsageMonitor.MemoryUsage

  • Enclosing class:
    MemoryUsageMonitor

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

      • MemoryUsage

        protected MemoryUsage​(double usedMemory,
                              double totalMemory,
                              double maximumMemory)
    • Method Detail

      • 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).