Name
java.lang.Runtime
Synopsis
This class is a stripped-down version of the J2SE
Runtime
class. Aside from the static
getRuntime()
method, which ensures a single
Runtime
object for the system, this class consists
of only four methods to encapsulate platform-dependent system
functions: two for monitoring total and currently used memory, one
for garbage collection, and one to exit the program.
public classRuntime
{ // static methods public static RuntimegetRuntime
(); // public instance methods public voidexit
(int status); public native longfreeMemory
(); public native voidgc
(); public native longtotalMemory
(); }
Get Wireless Java now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.