Java Code Examples for com.sun.management.GcInfo#from()

The following examples show how to use com.sun.management.GcInfo#from() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ValidateOpenTypes.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
private static void printGcInfo(CompositeData cd) throws Exception {
    GcInfo info = GcInfo.from(cd);
    System.out.print("GC #" + info.getId());
    System.out.print(" start:" + info.getStartTime());
    System.out.print(" end:" + info.getEndTime());
    System.out.println(" (" + info.getDuration() + "ms)");
    Map<String,MemoryUsage> usage = info.getMemoryUsageBeforeGc();

    for (Map.Entry<String,MemoryUsage> entry : usage.entrySet()) {
        String poolname = entry.getKey();
        MemoryUsage busage = entry.getValue();
        MemoryUsage ausage = info.getMemoryUsageAfterGc().get(poolname);
        if (ausage == null) {
            throw new RuntimeException("After Gc Memory does not exist" +
                " for " + poolname);
        }
        System.out.println("Usage for pool " + poolname);
        System.out.println("   Before GC: " + busage);
        System.out.println("   After GC: " + ausage);
    }
}
 
Example 2
Source File: ValidateOpenTypes.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
private static void printGcInfo(CompositeData cd) throws Exception {
    GcInfo info = GcInfo.from(cd);
    System.out.print("GC #" + info.getId());
    System.out.print(" start:" + info.getStartTime());
    System.out.print(" end:" + info.getEndTime());
    System.out.println(" (" + info.getDuration() + "ms)");
    Map<String,MemoryUsage> usage = info.getMemoryUsageBeforeGc();

    for (Map.Entry<String,MemoryUsage> entry : usage.entrySet()) {
        String poolname = entry.getKey();
        MemoryUsage busage = entry.getValue();
        MemoryUsage ausage = info.getMemoryUsageAfterGc().get(poolname);
        if (ausage == null) {
            throw new RuntimeException("After Gc Memory does not exist" +
                " for " + poolname);
        }
        System.out.println("Usage for pool " + poolname);
        System.out.println("   Before GC: " + busage);
        System.out.println("   After GC: " + ausage);
    }
}
 
Example 3
Source File: ValidateOpenTypes.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private static void printGcInfo(CompositeData cd) throws Exception {
    GcInfo info = GcInfo.from(cd);
    System.out.print("GC #" + info.getId());
    System.out.print(" start:" + info.getStartTime());
    System.out.print(" end:" + info.getEndTime());
    System.out.println(" (" + info.getDuration() + "ms)");
    Map<String,MemoryUsage> usage = info.getMemoryUsageBeforeGc();

    for (Map.Entry<String,MemoryUsage> entry : usage.entrySet()) {
        String poolname = entry.getKey();
        MemoryUsage busage = entry.getValue();
        MemoryUsage ausage = info.getMemoryUsageAfterGc().get(poolname);
        if (ausage == null) {
            throw new RuntimeException("After Gc Memory does not exist" +
                " for " + poolname);
        }
        System.out.println("Usage for pool " + poolname);
        System.out.println("   Before GC: " + busage);
        System.out.println("   After GC: " + ausage);
    }
}
 
Example 4
Source File: ValidateOpenTypes.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private static void printGcInfo(CompositeData cd) throws Exception {
    GcInfo info = GcInfo.from(cd);
    System.out.print("GC #" + info.getId());
    System.out.print(" start:" + info.getStartTime());
    System.out.print(" end:" + info.getEndTime());
    System.out.println(" (" + info.getDuration() + "ms)");
    Map<String,MemoryUsage> usage = info.getMemoryUsageBeforeGc();

    for (Map.Entry<String,MemoryUsage> entry : usage.entrySet()) {
        String poolname = entry.getKey();
        MemoryUsage busage = entry.getValue();
        MemoryUsage ausage = info.getMemoryUsageAfterGc().get(poolname);
        if (ausage == null) {
            throw new RuntimeException("After Gc Memory does not exist" +
                " for " + poolname);
        }
        System.out.println("Usage for pool " + poolname);
        System.out.println("   Before GC: " + busage);
        System.out.println("   After GC: " + ausage);
    }
}
 
Example 5
Source File: ValidateOpenTypes.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private static void printGcInfo(CompositeData cd) throws Exception {
    GcInfo info = GcInfo.from(cd);
    System.out.print("GC #" + info.getId());
    System.out.print(" start:" + info.getStartTime());
    System.out.print(" end:" + info.getEndTime());
    System.out.println(" (" + info.getDuration() + "ms)");
    Map<String,MemoryUsage> usage = info.getMemoryUsageBeforeGc();

    for (Map.Entry<String,MemoryUsage> entry : usage.entrySet()) {
        String poolname = entry.getKey();
        MemoryUsage busage = entry.getValue();
        MemoryUsage ausage = info.getMemoryUsageAfterGc().get(poolname);
        if (ausage == null) {
            throw new RuntimeException("After Gc Memory does not exist" +
                " for " + poolname);
        }
        System.out.println("Usage for pool " + poolname);
        System.out.println("   Before GC: " + busage);
        System.out.println("   After GC: " + ausage);
    }
}
 
Example 6
Source File: ValidateOpenTypes.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private static void printGcInfo(CompositeData cd) throws Exception {
    GcInfo info = GcInfo.from(cd);
    System.out.print("GC #" + info.getId());
    System.out.print(" start:" + info.getStartTime());
    System.out.print(" end:" + info.getEndTime());
    System.out.println(" (" + info.getDuration() + "ms)");
    Map<String,MemoryUsage> usage = info.getMemoryUsageBeforeGc();

    for (Map.Entry<String,MemoryUsage> entry : usage.entrySet()) {
        String poolname = entry.getKey();
        MemoryUsage busage = entry.getValue();
        MemoryUsage ausage = info.getMemoryUsageAfterGc().get(poolname);
        if (ausage == null) {
            throw new RuntimeException("After Gc Memory does not exist" +
                " for " + poolname);
        }
        System.out.println("Usage for pool " + poolname);
        System.out.println("   Before GC: " + busage);
        System.out.println("   After GC: " + ausage);
    }
}
 
Example 7
Source File: ValidateOpenTypes.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private static void printGcInfo(CompositeData cd) throws Exception {
    GcInfo info = GcInfo.from(cd);
    System.out.print("GC #" + info.getId());
    System.out.print(" start:" + info.getStartTime());
    System.out.print(" end:" + info.getEndTime());
    System.out.println(" (" + info.getDuration() + "ms)");
    Map<String,MemoryUsage> usage = info.getMemoryUsageBeforeGc();

    for (Map.Entry<String,MemoryUsage> entry : usage.entrySet()) {
        String poolname = entry.getKey();
        MemoryUsage busage = entry.getValue();
        MemoryUsage ausage = info.getMemoryUsageAfterGc().get(poolname);
        if (ausage == null) {
            throw new RuntimeException("After Gc Memory does not exist" +
                " for " + poolname);
        }
        System.out.println("Usage for pool " + poolname);
        System.out.println("   Before GC: " + busage);
        System.out.println("   After GC: " + ausage);
    }
}
 
Example 8
Source File: ValidateOpenTypes.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private static void printGcInfo(CompositeData cd) throws Exception {
    GcInfo info = GcInfo.from(cd);
    System.out.print("GC #" + info.getId());
    System.out.print(" start:" + info.getStartTime());
    System.out.print(" end:" + info.getEndTime());
    System.out.println(" (" + info.getDuration() + "ms)");
    Map<String,MemoryUsage> usage = info.getMemoryUsageBeforeGc();

    for (Map.Entry<String,MemoryUsage> entry : usage.entrySet()) {
        String poolname = entry.getKey();
        MemoryUsage busage = entry.getValue();
        MemoryUsage ausage = info.getMemoryUsageAfterGc().get(poolname);
        if (ausage == null) {
            throw new RuntimeException("After Gc Memory does not exist" +
                " for " + poolname);
        }
        System.out.println("Usage for pool " + poolname);
        System.out.println("   Before GC: " + busage);
        System.out.println("   After GC: " + ausage);
    }
}
 
Example 9
Source File: ValidateOpenTypes.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private static void printGcInfo(CompositeData cd) throws Exception {
    GcInfo info = GcInfo.from(cd);
    System.out.print("GC #" + info.getId());
    System.out.print(" start:" + info.getStartTime());
    System.out.print(" end:" + info.getEndTime());
    System.out.println(" (" + info.getDuration() + "ms)");
    Map<String,MemoryUsage> usage = info.getMemoryUsageBeforeGc();

    for (Map.Entry<String,MemoryUsage> entry : usage.entrySet()) {
        String poolname = entry.getKey();
        MemoryUsage busage = entry.getValue();
        MemoryUsage ausage = info.getMemoryUsageAfterGc().get(poolname);
        if (ausage == null) {
            throw new RuntimeException("After Gc Memory does not exist" +
                " for " + poolname);
        }
        System.out.println("Usage for pool " + poolname);
        System.out.println("   Before GC: " + busage);
        System.out.println("   After GC: " + ausage);
    }
}
 
Example 10
Source File: ValidateOpenTypes.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
private static void printGcInfo(CompositeData cd) throws Exception {
    GcInfo info = GcInfo.from(cd);
    System.out.print("GC #" + info.getId());
    System.out.print(" start:" + info.getStartTime());
    System.out.print(" end:" + info.getEndTime());
    System.out.println(" (" + info.getDuration() + "ms)");
    Map<String,MemoryUsage> usage = info.getMemoryUsageBeforeGc();

    for (Map.Entry<String,MemoryUsage> entry : usage.entrySet()) {
        String poolname = entry.getKey();
        MemoryUsage busage = entry.getValue();
        MemoryUsage ausage = info.getMemoryUsageAfterGc().get(poolname);
        if (ausage == null) {
            throw new RuntimeException("After Gc Memory does not exist" +
                " for " + poolname);
        }
        System.out.println("Usage for pool " + poolname);
        System.out.println("   Before GC: " + busage);
        System.out.println("   After GC: " + ausage);
    }
}
 
Example 11
Source File: GarbageCollectionNotifInfoCompositeData.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static GcInfo getGcInfo(CompositeData cd) {
    CompositeData gcInfoData = (CompositeData) cd.get(GC_INFO);
    return GcInfo.from(gcInfoData);
}
 
Example 12
Source File: GarbageCollectionNotifInfoCompositeData.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public static GcInfo getGcInfo(CompositeData cd) {
    CompositeData gcInfoData = (CompositeData) cd.get(GC_INFO);
    return GcInfo.from(gcInfoData);
}
 
Example 13
Source File: GarbageCollectionNotifInfoCompositeData.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public static GcInfo getGcInfo(CompositeData cd) {
    CompositeData gcInfoData = (CompositeData) cd.get(GC_INFO);
    return GcInfo.from(gcInfoData);
}
 
Example 14
Source File: GarbageCollectionNotifInfoCompositeData.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static GcInfo getGcInfo(CompositeData cd) {
    CompositeData gcInfoData = (CompositeData) cd.get(GC_INFO);
    return GcInfo.from(gcInfoData);
}
 
Example 15
Source File: GarbageCollectionNotifInfoCompositeData.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static GcInfo getGcInfo(CompositeData cd) {
    CompositeData gcInfoData = (CompositeData) cd.get(GC_INFO);
    return GcInfo.from(gcInfoData);
}
 
Example 16
Source File: GarbageCollectionNotifInfoCompositeData.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static GcInfo getGcInfo(CompositeData cd) {
    CompositeData gcInfoData = (CompositeData) cd.get(GC_INFO);
    return GcInfo.from(gcInfoData);
}
 
Example 17
Source File: GarbageCollectionNotifInfoCompositeData.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static GcInfo getGcInfo(CompositeData cd) {
    CompositeData gcInfoData = (CompositeData) cd.get(GC_INFO);
    return GcInfo.from(gcInfoData);
}
 
Example 18
Source File: GarbageCollectionNotifInfoCompositeData.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public static GcInfo getGcInfo(CompositeData cd) {
    CompositeData gcInfoData = (CompositeData) cd.get(GC_INFO);
    return GcInfo.from(gcInfoData);
}
 
Example 19
Source File: GarbageCollectionNotifInfoCompositeData.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public static GcInfo getGcInfo(CompositeData cd) {
    CompositeData gcInfoData = (CompositeData) cd.get(GC_INFO);
    return GcInfo.from(gcInfoData);
}
 
Example 20
Source File: GarbageCollectionNotifInfoCompositeData.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static GcInfo getGcInfo(CompositeData cd) {
    CompositeData gcInfoData = (CompositeData) cd.get(GC_INFO);
    return GcInfo.from(gcInfoData);
}