Class CmsMemoryStatus

java.lang.Object
org.opencms.monitor.CmsMemoryStatus
All Implemented Interfaces:
Serializable

public class CmsMemoryStatus extends Object implements Serializable
Data structure for dealing with memory status information.

Since:
6.0.0
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initializes a new instance of the memory status with the current memory values.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Calculates the average memory consumption by updating the stored information with the provided current information.
    int
    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
    Returns the current memory usage, in percent.
    long
    Returns the amount of memory currently used, in megabytes.
    void
    Updates this memory status with the current memory information.

    Methods inherited from class java.lang.Object

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

    • CmsMemoryStatus

      public CmsMemoryStatus()
      Initializes a new instance of the memory status with the current memory values.

  • Method Details

    • calculateAverage

      public void calculateAverage(CmsMemoryStatus currentStatus)
      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

      public int getCount()
      Returns the count used to calculate the average.

      Returns:
      the count used to calculate the average
    • getFreeMemory

      public long getFreeMemory()
      Returns the current free memory, in megabytes.

      Returns:
      the current free memory, in megabytes
    • getMaxMemory

      public long getMaxMemory()
      Returns the maximum available memory, in megabytes.

      Returns:
      the maximum available memory, in megabytes
    • getTotalMemory

      public long 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

      public long getUsage()
      Returns the current memory usage, in percent.

      Returns:
      the current memory usage, in percent
    • getUsedMemory

      public long getUsedMemory()
      Returns the amount of memory currently used, in megabytes.

      Returns:
      the amount of memory currently used, in megabytes
    • update

      public void update()
      Updates this memory status with the current memory information.