Package org.sm.smtools.application.util
Class SystemInformation
java.lang.Object
org.sm.smtools.application.util.SystemInformation
public final class SystemInformation
extends java.lang.Object
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
Nested Classes Modifier and Type Class Description static class
SystemInformation.EOperatingSystem
The different types of operating systems. -
Method Summary
Modifier and Type Method Description static long
getFreeMemory()
Returns the amount of free memory for the application.static int
getNrOfProcessors()
Returns the number of processors for the JVM.static SystemInformation.EOperatingSystem
getOperatingSystem()
Returns the type of operating system.static long
getTotalMemory()
Returns the total available memory that the JVM can have access to.static long
getUsedMemory()
Returns the amount of memory currently used by the JVM.Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
-