From the JDK 1.1.7B javadocs for java.lang.System.
 
gc
 public static void gc()
Runs the garbage collector.

Calling the gc method suggests that the Java Virtual Machine expend effort toward recycling unused objects in order to make the memory they currently occupy available for quick reuse. When control returns from the method call, the Java Virtual Machine has made a best effort to reclaim space from all unused objects.

See Also:
gc
 o runFinalization
 public static void runFinalization()
Runs the finalization methods of any objects pending finalization.

Calling this method suggests that the Java Virtual Machine expend effort toward running the finalize methods of objects that have been found to be discarded but whose finalize methods have not yet been run. When control returns from the method call, the Java Virtual Machine has made a best effort to complete all outstanding finalizations.

See Also:
runFinalization
 o runFinalizersOnExit
 public static void runFinalizersOnExit(boolean value)
Enable or disable finalization on exit; doing so specifies that the finalizers of all objects that have finalizers that have not yet been automatically invoked are to be run before the Java runtime exits. By default, finalization on exit is disabled.

See Also:
exit, gc
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference [mailto:[EMAIL PROTECTED]]On Behalf Of Campbell
Sent: Thursday, November 04, 1999 10:21 AM
To: [EMAIL PROTECTED]
Subject: Garbage collection

(more of a java q, but seems fitting...)
 
Is there a way to force garbage collection, such as with delete in C++?
 
Phil

Reply via email to