Package com.decs.application.services
Class SystemManager
java.lang.Object
com.decs.application.services.SystemManager
System Manager Class
This class handles tasks related with the system's execution environment (Java Virtual Machine)
- Version:
- 1.0
- Author:
- Bruno Guiomar
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longbytes2gigaBytes(long value) Converts a value expressed in Bytes to GigaBytesstatic longbytes2megaBytes(long value) Converts a value expressed in Bytes to MegaBytesstatic longcomputeMemoryUsage(long initial, long finish) Computes the amount of used memory between two readingslonglong
-
Field Details
-
memoryMXBean
-
-
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 valuefinish- 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
-