Package org.opencms.monitor
Class CmsMemoryStatus
java.lang.Object
org.opencms.monitor.CmsMemoryStatus
- All Implemented Interfaces:
Serializable
Data structure for dealing with memory status information.
- Since:
- 6.0.0
- See Also:
-
Constructor Summary
ConstructorDescriptionInitializes a new instance of the memory status with the current memory values. -
Method Summary
Modifier and TypeMethodDescriptionvoid
calculateAverage
(CmsMemoryStatus currentStatus) Calculates the average memory consumption by updating the stored information with the provided current information.int
getCount()
Returns the count used to calculate the average.long
Returns the current free memory, in megabytes.long
Returns the maximum available memory, in megabytes.long
Returns the amount of memory currently availble to the JVM, in megabytes.long
getUsage()
Returns the current memory usage, in percent.long
Returns the amount of memory currently used, in megabytes.void
update()
Updates this memory status with the current memory information.
-
Constructor Details
-
CmsMemoryStatus
public CmsMemoryStatus()Initializes a new instance of the memory status with the current memory values.
-
-
Method Details
-
calculateAverage
Calculates the average memory consumption by updating the stored information with the provided current information.- Parameters:
currentStatus
- the memory status to update the average with
-
getCount
Returns the count used to calculate the average.- Returns:
- the count used to calculate the average
-
getFreeMemory
Returns the current free memory, in megabytes.- Returns:
- the current free memory, in megabytes
-
getMaxMemory
Returns the maximum available memory, in megabytes.- Returns:
- the maximum available memory, in megabytes
-
getTotalMemory
Returns the amount of memory currently availble to the JVM, in megabytes.- Returns:
- the amount of memory currently availble to the JVM, in megabytes
-
getUsage
Returns the current memory usage, in percent.- Returns:
- the current memory usage, in percent
-
getUsedMemory
Returns the amount of memory currently used, in megabytes.- Returns:
- the amount of memory currently used, in megabytes
-
update
Updates this memory status with the current memory information.
-