OpenJDK / type-annotations / type-annotations / jdk
changeset 9015:4afe1281c837
6987597: ManagementFactory.getGarbageCollectorMXBeans() returns empty list with CMS
Reviewed-by: mchung
author | jbachorik |
---|---|
date | Thu, 28 Nov 2013 09:10:18 +0100 |
parents | 5ac7cd164300 |
children | 5bcaf730ceb8 |
files | test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java |
diffstat | 2 files changed, 10 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java Wed Nov 27 15:25:36 2013 -0800 +++ b/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java Thu Nov 28 09:10:18 2013 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,11 @@ * @summary Sanity Test for GarbageCollectorMXBean.getLastGcInfo(). * @author Mandy Chung * - * @run main LastGCInfo + * @run main/othervm -XX:-ExplicitGCInvokesConcurrent LastGCInfo */ +// Passing "-XX:-ExplicitGCInvokesConcurrent" to force System.gc() +// run on foreground when CMS is used and prevent situations when "GcInfo" +// is missing even though System.gc() was successfuly processed. import java.lang.management.ManagementFactory; import java.lang.management.MemoryUsage;
--- a/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java Wed Nov 27 15:25:36 2013 -0800 +++ b/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java Thu Nov 28 09:10:18 2013 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,8 +26,11 @@ * @bug 6396794 * @summary Check that LastGcInfo contents are reasonable * @author Eamonn McManus - * @run main/othervm GcInfoCompositeType + * @run main/othervm -XX:-ExplicitGCInvokesConcurrent GcInfoCompositeType */ +// Passing "-XX:-ExplicitGCInvokesConcurrent" to force System.gc() +// run on foreground when CMS is used and prevent situations when "GcInfo" +// is missing even though System.gc() was successfuly processed. import java.util.*; import java.lang.management.*;