use of java.lang.management.ClassLoadingMXBean in project jdk8u_jdk by JetBrains.
the class MXBeanInteropTest1 method doClassLoadingMXBeanTest.
private final int doClassLoadingMXBeanTest(MBeanServerConnection mbsc) {
int errorCount = 0;
System.out.println("---- ClassLoadingMXBean");
try {
ObjectName classLoadingName = new ObjectName(ManagementFactory.CLASS_LOADING_MXBEAN_NAME);
MBeanInfo mbInfo = mbsc.getMBeanInfo(classLoadingName);
errorCount += checkNonEmpty(mbInfo);
System.out.println("getMBeanInfo\t\t" + mbInfo);
ClassLoadingMXBean classLoading = null;
classLoading = JMX.newMXBeanProxy(mbsc, classLoadingName, ClassLoadingMXBean.class);
System.out.println("getLoadedClassCount\t\t" + classLoading.getLoadedClassCount());
System.out.println("getTotalLoadedClassCount\t\t" + classLoading.getTotalLoadedClassCount());
System.out.println("getUnloadedClassCount\t\t" + classLoading.getUnloadedClassCount());
System.out.println("isVerbose\t\t" + classLoading.isVerbose());
System.out.println("---- OK\n");
} catch (Exception e) {
Utils.printThrowable(e, true);
errorCount++;
System.out.println("---- ERROR\n");
}
return errorCount;
}
use of java.lang.management.ClassLoadingMXBean in project Gargoyle by callakrsos.
the class CPUUsageTest method showClassLoading.
public void showClassLoading() {
ClassLoadingMXBean classbean = ManagementFactory.getClassLoadingMXBean();
System.out.println("TotalLoadedClassCount: " + classbean.getTotalLoadedClassCount());
System.out.println("LoadedClassCount: " + classbean.getLoadedClassCount());
System.out.println("UnloadedClassCount: " + classbean.getUnloadedClassCount());
}
Aggregations