9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 6396794
27 * @summary Check that LastGcInfo contents are reasonable
28 * @author Eamonn McManus
29 * @modules jdk.management
30 * @run main/othervm -XX:-ExplicitGCInvokesConcurrent GcInfoCompositeType
31 */
32 // Passing "-XX:-ExplicitGCInvokesConcurrent" to force System.gc()
33 // run on foreground when CMS is used and prevent situations when "GcInfo"
34 // is missing even though System.gc() was successfuly processed.
35
36 import java.util.*;
37 import java.lang.management.*;
38 import java.lang.reflect.*;
39 import javax.management.*;
40 import javax.management.openmbean.*;
41 import com.sun.management.GcInfo;
42
43 public class GcInfoCompositeType {
44 private static int tested = 0;
45
46 public static void main(String[] args) throws Exception {
47 MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
48 final ObjectName gcMXBeanPattern =
49 new ObjectName("java.lang:type=GarbageCollector,*");
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 6396794
27 * @summary Check that LastGcInfo contents are reasonable
28 * @author Eamonn McManus
29 *
30 * @modules jdk.management
31 *
32 * @run main/othervm -XX:-ExplicitGCInvokesConcurrent GcInfoCompositeType
33 */
34 // Passing "-XX:-ExplicitGCInvokesConcurrent" to force System.gc()
35 // run on foreground when CMS is used and prevent situations when "GcInfo"
36 // is missing even though System.gc() was successfuly processed.
37
38 import java.util.*;
39 import java.lang.management.*;
40 import java.lang.reflect.*;
41 import javax.management.*;
42 import javax.management.openmbean.*;
43 import com.sun.management.GcInfo;
44
45 public class GcInfoCompositeType {
46 private static int tested = 0;
47
48 public static void main(String[] args) throws Exception {
49 MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
50 final ObjectName gcMXBeanPattern =
51 new ObjectName("java.lang:type=GarbageCollector,*");
|