Search in sources :

Example 11 with ClassLoadingMXBean

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;
}
Also used : MBeanInfo(javax.management.MBeanInfo) ClassLoadingMXBean(java.lang.management.ClassLoadingMXBean) ObjectName(javax.management.ObjectName)

Example 12 with ClassLoadingMXBean

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());
}
Also used : ClassLoadingMXBean(java.lang.management.ClassLoadingMXBean)

Aggregations

ClassLoadingMXBean (java.lang.management.ClassLoadingMXBean)12 MemoryMXBean (java.lang.management.MemoryMXBean)5 RuntimeMXBean (java.lang.management.RuntimeMXBean)5 OperatingSystemMXBean (java.lang.management.OperatingSystemMXBean)4 ThreadMXBean (java.lang.management.ThreadMXBean)4 GarbageCollectorMXBean (java.lang.management.GarbageCollectorMXBean)3 MemoryUsage (java.lang.management.MemoryUsage)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 Function (com.google.common.base.Function)1 UnixOperatingSystemMXBean (com.sun.management.UnixOperatingSystemMXBean)1 MemoryPoolMXBean (java.lang.management.MemoryPoolMXBean)1 ArrayList (java.util.ArrayList)1 Properties (java.util.Properties)1 TreeMap (java.util.TreeMap)1 MBeanInfo (javax.management.MBeanInfo)1 ObjectName (javax.management.ObjectName)1 Gauge (org.apache.flink.metrics.Gauge)1 InfoProvider (org.apache.karaf.shell.commands.info.InfoProvider)1 Resource (org.springframework.core.io.Resource)1