public void update ( ) { // grab the various system properties osName = System . getProperty ( "os.name" ) ; osVersion = System . getProperty ( "os.version" ) ; osArch = System . getProperty ( "os.arch" ) ; javaVersion = System . getProperty ( "java.version" ) ; javaVendor = System . getProperty ( "java.vendor" ) ; // determine memory usage Runtime rtime = Runtime . getRuntime ( ) ; freeMemory = rtime . freeMemory ( ) / 1024 ; totalMemory = rtime . totalMemory ( ) / 1024 ; usedMemory = totalMemory - freeMemory ; maxMemory = rtime . maxMemory ( ) / 1024 ; // determine video display information isHeadless = GraphicsEnvironment . isHeadless ( ) ; if ( ! isHeadless ) { try { GraphicsEnvironment env = GraphicsEnvironment . getLocalGraphicsEnvironment ( ) ; GraphicsDevice gd = env . getDefaultScreenDevice ( ) ; DisplayMode mode = gd . getDisplayMode ( ) ; bitDepth = mode . getBitDepth ( ) ; refreshRate = mode . getRefreshRate ( ) / 1024 ; isFullScreen = ( gd . getFullScreenWindow ( ) != null ) ; displayWidth = mode . getWidth ( ) ; displayHeight = mode . getHeight ( ) ; } catch ( Throwable t ) { isHeadless = true ; } } }
Updates the system info record s statistics to reflect the current state of the JVM .