Object Jvm

  • All Implemented Interfaces:

    
    public class Jvm
    
                        

    Object with utilities to gather information about the running JVM.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String totalMemory() Amount of memory in kilobytes available to the JVM.
      final String usedMemory() Amount of used memory in kilobytes.
      final <T extends Any> T systemSettingOrNull(KClass<T> type, String name) Retrieve a setting by name by looking in the JVM system properties first and in OS environment variables if not found.
      final <T extends Any> T systemSettingOrNull(String name) Utility method for retrieving a system setting, check systemSettingOrNull for details.
      final <T extends Any> T systemSetting(KClass<T> type, String name)
      final <T extends Any> T systemSetting(String name)
      final Boolean systemFlag(String name) Retrieve a flag (boolean parameter) by name by looking in the JVM system properties first and in OS environment variables if not found.
      final Runtime getRuntime() Current JVM runtime.
      final TimeZone getTimeZone() Default timezone.
      final ZoneId getZoneId() Default zone ID.
      final Charset getCharset() Default character set.
      final Locale getLocale() Default locale for this instance of the Java Virtual Machine.
      final String getHostName() The host name of the machine running this program.
      final String getIp() The IP address of the machine running this program.
      final String getName() Name of the JVM running this program.
      final String getVersion() Java version aka language level.
      final Integer getCpuCount() Number of processors available to the Java virtual machine.
      final String getLocaleCode() User locale consist of 2-letter language code, 2-letter country code and file encoding.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • totalMemory

         final String totalMemory()

        Amount of memory in kilobytes available to the JVM.

      • usedMemory

         final String usedMemory()

        Amount of used memory in kilobytes.

      • systemSettingOrNull

         final <T extends Any> T systemSettingOrNull(KClass<T> type, String name)

        Retrieve a setting by name by looking in the JVM system properties first and in OS environment variables if not found.

        Parameters:
        type - Type of the requested parameter.
        name - Name of the searched parameter, can not be blank.
      • systemSettingOrNull

         final <T extends Any> T systemSettingOrNull(String name)

        Utility method for retrieving a system setting, check systemSettingOrNull for details.

        Parameters:
        name - Name of the searched parameter, can not be blank.
      • systemSetting

         final <T extends Any> T systemSetting(KClass<T> type, String name)
      • systemFlag

         final Boolean systemFlag(String name)

        Retrieve a flag (boolean parameter) by name by looking in the JVM system properties first and in OS environment variables if not found.

        Parameters:
        name - Name of the searched parameter, can not be blank.
      • getRuntime

         final Runtime getRuntime()

        Current JVM runtime.

      • getTimeZone

         final TimeZone getTimeZone()

        Default timezone.

      • getZoneId

         final ZoneId getZoneId()

        Default zone ID.

      • getCharset

         final Charset getCharset()

        Default character set.

      • getLocale

         final Locale getLocale()

        Default locale for this instance of the Java Virtual Machine.

      • getHostName

         final String getHostName()

        The host name of the machine running this program.

      • getIp

         final String getIp()

        The IP address of the machine running this program.

      • getName

         final String getName()

        Name of the JVM running this program. For example: OpenJDK 64-Bit Server VM.

      • getVersion

         final String getVersion()

        Java version aka language level. For example: 11

      • getCpuCount

         final Integer getCpuCount()

        Number of processors available to the Java virtual machine.

      • getLocaleCode

         final String getLocaleCode()

        User locale consist of 2-letter language code, 2-letter country code and file encoding.