Package java.lang.management

Examples of java.lang.management.MemoryMXBean.gc()


        Introspector.flushCaches();
        LogFactory.releaseAll();

        // invoke the garbage collector
        out.println(MSG.getMsg(AgentI18NResourceKeys.GC_INVOKE));
        memoryMxBean.gc();

        printGlobalMemoryUsage(out, memoryMxBean);
        return;
    }
View Full Code Here


    @Override
    public boolean dispatch(KeyEvent evt, ApplicationWindow window) {
        MemoryMXBean memory = ManagementFactory.getMemoryMXBean();
        System.out.println("*** Before GC ***");
        reportStatus(memory);
        memory.gc();
        System.out.println();
        System.out.println("*** After GC ***");
        reportStatus(memory);
        return false;
    }
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.