Package net.algart.finalizing

Examples of net.algart.finalizing.Finalizer.activeTasksCount()


                    throw new RuntimeException("Internal error: array should be changed here!");
            }
            System.out.println();
            System.out.println();
        }
        System.out.println("Number of finalization tasks: " + fin.activeTasksCount());
        if (args.length >= 2 && args[1].equalsIgnoreCase("gc")) {
            System.out.println("Calling System.gc()");
            System.gc();
//            fin.shutdownNow(); // uncomment this to cancel finalization
            if (args.length >= 3 && args[2].equalsIgnoreCase("waitaftergc")) {
View Full Code Here


            System.gc();
//            fin.shutdownNow(); // uncomment this to cancel finalization
            if (args.length >= 3 && args[2].equalsIgnoreCase("waitaftergc")) {
                System.out.println("Waiting for all finalization tasks...");
                while (true) {
                    int count = fin.activeTasksCount();
                    System.out.println("Number of finalization tasks: " + count);
                    if (count == 0)
                        break;
                    try {
                        Thread.sleep(300);
View Full Code Here

                pause("File will be deleted on exit", "the test will be finished");
            }
        }
        if (gcBeforeExit) {
            long t = System.currentTimeMillis();
            System.out.println("Active task count: " + fin.activeTasksCount());
            while (fin.activeTasksCount() > 0) {
                System.runFinalization();
                System.gc();
                Thread.sleep(50);
                if (System.currentTimeMillis() - t > 5000)
View Full Code Here

            }
        }
        if (gcBeforeExit) {
            long t = System.currentTimeMillis();
            System.out.println("Active task count: " + fin.activeTasksCount());
            while (fin.activeTasksCount() > 0) {
                System.runFinalization();
                System.gc();
                Thread.sleep(50);
                if (System.currentTimeMillis() - t > 5000)
                    break;
View Full Code Here

                System.runFinalization();
                System.gc();
                Thread.sleep(50);
                if (System.currentTimeMillis() - t > 5000)
                    break;
                System.out.println("Active task count: " + fin.activeTasksCount());
            }
            for (int k = 0; k < 5; k++) {
                // finalizing some additional objects that could be
                // referred from finalization tasks performed above
                System.runFinalization();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.