java.lang
Class Runtime

java.lang.Object
  extended by java.lang.Runtime

public final class Runtime
extends Object


Method Summary
 void addShutdownHook(Thread hook)
          Registers a new virtual-machine shutdown hook.
 int availableProcessors()
          Returns the number of processors available to the Java virtual machine.
 void exit(int status)
          Terminates the currently running Java virtual machine by initiating its shutdown sequence.
 long freeMemory()
          Returns the amount of free memory in the Java Virtual Machine.
 void gc()
          Runs the garbage collector.
static Runtime getRuntime()
          Returns the runtime object associated with the current Java application.
 void halt(int status)
          Forcibly terminates the currently running Java virtual machine.
 long maxMemory()
          Returns the maximum amount of memory that the Java virtual machine will attempt to use.
 boolean removeShutdownHook(Thread hook)
          De-registers a previously-registered virtual-machine shutdown hook.
 long totalMemory()
          Returns the total amount of memory in the Java virtual machine.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Method Detail

addShutdownHook

public void addShutdownHook(Thread hook)
Registers a new virtual-machine shutdown hook.


availableProcessors

public int availableProcessors()
Returns the number of processors available to the Java virtual machine.


exit

public void exit(int status)
Terminates the currently running Java virtual machine by initiating its shutdown sequence.


freeMemory

public long freeMemory()
Returns the amount of free memory in the Java Virtual Machine.


gc

public void gc()
Runs the garbage collector.


getRuntime

public static Runtime getRuntime()
Returns the runtime object associated with the current Java application.


halt

public void halt(int status)
Forcibly terminates the currently running Java virtual machine.


maxMemory

public long maxMemory()
Returns the maximum amount of memory that the Java virtual machine will attempt to use.


removeShutdownHook

public boolean removeShutdownHook(Thread hook)
De-registers a previously-registered virtual-machine shutdown hook.


totalMemory

public long totalMemory()
Returns the total amount of memory in the Java virtual machine.