This section describes the system Runtime object and the Runtime.getRuntime() method to get it from the JVM.
When a Java application program is running inside a JVM, the JVM offers an instance of the
Runtime class to the program. The Java program can use this Runtime instance
to interact with the JVM and the supporting operating system.
There are several interesting types of methods available on the Runtime instance:
Getting dynamic information about the JVM, like freeMemory().
Launching a separate process at the operating system level, like exec().
Interacting with the shutdown sequence of the JVM, like addShutdownHook().
Forcing an immediate garbage collection job on the JVM, like gc().
The Runtime class is a special class. It represents the run time environment of
the Java application program running inside the JVM.
You can not create a new instance of Runtim class in your application program.
You can only get the instance created by the JVM for your application program by
calling the Runtime.getRuntime() method.