|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Runtime
Every Java application has a single instance of class
Runtime
that allows the application to interface with
the environment in which the application is running. The current
runtime can be obtained from the getRuntime
method.
An application cannot create its own instance of this class.
getRuntime()
Method Summary | |
long |
freeMemory()
Returns the amount of free memory in the system. |
static Runtime |
getRuntime()
Returns the runtime object associated with the current Java application. |
long |
totalMemory()
Returns the total amount of memory in the Java Virtual Machine. |
void |
traceInstructions(boolean on)
Enables/Disables tracing of instructions. |
void |
traceMethodCalls(boolean on)
Enables/Disables tracing of method calls. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
Method Detail |
public long freeMemory()
gc
method may result in increasing the value returned
by freeMemory.
public static Runtime getRuntime()
Runtime
are instance
methods and must be invoked with respect to the current runtime object.
Runtime
object associated with the current
Java application.public long totalMemory()
Note that the amount of memory required to hold an object of any given type may be implementation-dependent.
public void traceInstructions(boolean on)
boolean
argument is true
, this
method suggests that the Java Virtual Machine emit debugging
information for each instruction in the Java Virtual Machine as it
is executed. The format of this information, and the file or other
output stream to which it is emitted, depends on the host environment.
The virtual machine may ignore this request if it does not support
this feature. The destination of the trace output is system
dependent.
If the boolean
argument is false
, this
method causes the Java Virtual Machine to stop performing the
detailed instruction trace it is performing.
on
- true
to enable instruction tracing;
false
to disable this feature.public void traceMethodCalls(boolean on)
boolean
argument is true
, this
method suggests that the Java Virtual Machine emit debugging
information for each method in the Java Virtual Machine as it is
called. The format of this information, and the file or other output
stream to which it is emitted, depends on the host environment. The
virtual machine may ignore this request if it does not support
this feature.
Calling this method with argument false suggests that the Java Virtual Machine cease emitting per-call debugging information.
on
- true
to enable instruction tracing;
false
to disable this feature.
|
MIT ACM/IEEE Programming Competition |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |