Class SystemManager

java.lang.Object
com.decs.application.services.SystemManager

@Service public class SystemManager extends Object
System Manager Class

This class handles tasks related with the system's execution environment (Java Virtual Machine)

Version:
1.0
Author:
Bruno Guiomar
  • Field Details

  • Constructor Details

    • SystemManager

      public SystemManager()
      Class Constructor
  • Method Details

    • computeMemoryUsage

      public static long computeMemoryUsage(long initial, long finish)
      Computes the amount of used memory between two readings
      Parameters:
      initial - Initial memory usage value
      finish - Final memory usage value
      Returns:
      Difference between the final and initial vaues
    • getHeapMemoryUsed

      public long getHeapMemoryUsed()
      Returns:
      Amount of committed heap memory in bytes
    • getNonHeapMemoryUsed

      public long getNonHeapMemoryUsed()
      Returns:
      Amount of committed non-heap memory in bytes
    • bytes2megaBytes

      public static long bytes2megaBytes(long value)
      Converts a value expressed in Bytes to MegaBytes
      Parameters:
      value - Value in Bytes
      Returns:
      Value in MegaBytes
    • bytes2gigaBytes

      public static long bytes2gigaBytes(long value)
      Converts a value expressed in Bytes to GigaBytes
      Parameters:
      value - Value in Bytes
      Returns:
      Value in GigaBytes