Condividi tramite


Runtime.RunFinalization Method

Definition

Runs the finalization methods of any objects pending finalization.

[Android.Runtime.Register("runFinalization", "()V", "GetRunFinalizationHandler")]
public virtual void RunFinalization ();
[<Android.Runtime.Register("runFinalization", "()V", "GetRunFinalizationHandler")>]
abstract member RunFinalization : unit -> unit
override this.RunFinalization : unit -> unit
Attributes

Remarks

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 virtual machine has made a best effort to complete all outstanding finalizations.

The virtual machine performs the finalization process automatically as needed, in a separate thread, if the runFinalization method is not invoked explicitly.

The method System#runFinalization() is the conventional and convenient means of invoking this method.

Java documentation for java.lang.Runtime.runFinalization().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to