Package org.sm.smtools.application.util
Class SystemInformation
java.lang.Object
org.sm.smtools.application.util.SystemInformation
The
SystemInformation
class allows gathering of some system information, such as Java VM memory statistics, number of CPUs, and the OS name.
Note that this class cannot be subclassed, nor instantiated!
- Version:
- 23/06/2015
- Author:
- Sven Maerivoet
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The different types of operating systems. -
Method Summary
Modifier and TypeMethodDescriptionstatic long
Returns the amount of free memory for the application.static int
Returns the number of processors for the JVM.Returns the type of operating system.static long
Returns the total available memory that the JVM can have access to.static long
Returns the amount of memory currently used by the JVM.
-
Method Details
-
getTotalMemory
public static long getTotalMemory()Returns the total available memory that the JVM can have access to.- Returns:
- the total available memory (in bytes) that the JVM can have access to
-
getUsedMemory
public static long getUsedMemory()Returns the amount of memory currently used by the JVM.- Returns:
- the amount of memory (in bytes) currently used by the JVM
-
getFreeMemory
public static long getFreeMemory()Returns the amount of free memory for the application.- Returns:
- the amount of free memory (in bytes) for the application
-
getNrOfProcessors
public static int getNrOfProcessors()Returns the number of processors for the JVM.- Returns:
- the number of processors for the JVM
-
getOperatingSystem
Returns the type of operating system.- Returns:
- the type of operating system
-