Class CmsMemoryStatus

  • All Implemented Interfaces:
    java.io.Serializable

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

    Since:
    6.0.0
    See Also:
    Serialized Form
    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void 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 getFreeMemory()
      Returns the current free memory, in megabytes.
      long getMaxMemory()
      Returns the maximum available memory, in megabytes.
      long getTotalMemory()
      Returns the amount of memory currently availble to the JVM, in megabytes.
      long getUsage()
      Returns the current memory usage, in percent.
      long getUsedMemory()
      Returns the amount of memory currently used, in megabytes.
      void update()
      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 Detail

      • CmsMemoryStatus

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

    • Method Detail

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