Class SystemHelper

java.lang.Object
com.helger.base.system.SystemHelper

@Immutable public final class SystemHelper extends Object
Get information about the system we're running on.
Author:
Philip Helger
  • Method Details

    • getNumberOfProcessors

      @Nonnegative public static int getNumberOfProcessors()
      Returns:
      The number of processors the computer has.
    • getProcessorArchitecture

      public static @NonNull EProcessorArchitecture getProcessorArchitecture()
      Returns:
      The current processor architecture and never null.
    • getOperatingSystem

      public static @NonNull EOperatingSystem getOperatingSystem()
      Returns:
      The operating system we're running on.
    • getOperatingSystemName

      public static @NonNull String getOperatingSystemName()
      Returns:
      The name and version of the operating system we're running on.
    • getJavaVersion

      public static @NonNull EJavaVersion getJavaVersion()
      Returns:
      The current Java version that is running. Never null.
    • getJVMVendor

      public static @NonNull EJVMVendor getJVMVendor()
      Returns:
      The vendor of the Java Virtual Machine (JVM) that we're operating on.
    • getSystemLocale

      public static @NonNull Locale getSystemLocale()
      Returns:
      The system locale.
    • getSystemCharset

      public static @NonNull Charset getSystemCharset()
      Returns:
      The system charset.
    • getSystemCharsetName

      public static @NonNull String getSystemCharsetName()
      Returns:
      The name of the system charset.
    • getFreeMemory

      @Nonnegative public static long getFreeMemory()
      Returns the amount of free memory in the Java Virtual Machine.
      Returns:
      an approximation to the total amount of memory currently available for future allocated objects, measured in bytes.
    • getMaxMemory

      @Nonnegative public static long getMaxMemory()
      Returns the maximum amount of memory that the Java virtual machine will attempt to use. If there is no inherent limit then the value Long.MAX_VALUE will be returned.
      Returns:
      the maximum amount of memory that the virtual machine will attempt to use, measured in bytes
    • getTotalMemory

      @Nonnegative public static long getTotalMemory()
      Returns the total amount of memory in the Java virtual machine. The value returned by this method may vary over time, depending on the host environment.

      Note that the amount of memory required to hold an object of any given type may be implementation-dependent.

      Returns:
      the total amount of memory currently available for current and future objects, measured in bytes.