Package org.jivesoftware.util
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MemoryUsageMonitor.MemoryUsage
createSnapshot()
Creates a snapshot of the current memory usage.double
getMaximumMemory()
Returns the maximum amount of memory available to Openfire, including used, free and as-of-yet unallocated memory, in megabytes.int
getPercent()
Returns the percentage of the maximum memory that is currently used by Openfire, rounded to the nearest integer value.double
getPercentUsed()
Returns the percentage of the maximum memory that is currently being used by Openfire.double
getTotalMemory()
Returns the total amount of memory available to Openfire, including used and free memory, in megabytes.double
getUsedMemory()
Returns the amount of memory currently used by Openfire (memory populated with objects), in megabytes.
-
-
-
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).
-
-