Run garbage collector and finalization methods

ReturnMethodSummary
voidgc()Runs the garbage collector.
voidrunFinalization()Runs the finalization methods of any objects pending finalization.

public class Main {
  public static void main(String[] args) {
    Runtime runtime = Runtime.getRuntime();

    runtime.gc();
    runtime.runFinalization();
    
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.