This commit is contained in:
Erik Helin 2016-01-15 17:36:47 +01:00
commit b910aaf967
4 changed files with 64 additions and 31 deletions

View File

@ -131,13 +131,12 @@ compact3 = \
# Tests that require compact3 API's
#
needs_compact3 = \
gc/6581734/Test6581734.java \
gc/7072527/TestFullGCCount.java \
gc/g1/TestHumongousAllocInitialMark.java \
gc/TestFullGCCount.java \
gc/arguments/TestG1HeapRegionSize.java \
gc/metaspace/TestMetaspaceMemoryPool.java \
gc/arguments/TestDynMinHeapFreeRatio.java \
gc/arguments/TestDynMaxHeapFreeRatio.java \
gc/cms/TestMBeanCMS.java \
gc/g1/TestHumongousAllocInitialMark.java \
gc/g1/TestShrinkAuxiliaryData00.java \
gc/g1/TestShrinkAuxiliaryData05.java \
gc/g1/TestShrinkAuxiliaryData10.java \
@ -145,6 +144,7 @@ needs_compact3 = \
gc/g1/TestShrinkAuxiliaryData20.java \
gc/g1/TestShrinkAuxiliaryData25.java \
gc/g1/TestShrinkAuxiliaryData30.java \
gc/metaspace/TestMetaspaceMemoryPool.java \
gc/survivorAlignment \
runtime/InternalApi/ThreadCpuTimesDeadlock.java \
runtime/NMT/JcmdSummaryDiff.java \

View File

@ -1,10 +1,32 @@
/*
@test
@bug 6845368
@summary ensure gc updates references > 64K bytes from the start of the obj
@author John Coomes
@run main/othervm/timeout=720 -Xmx64m bigobj
*/
* Copyright (c) 2009, 2016, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test TestBigObj
* @bug 6845368
* @summary ensure gc updates references > 64K bytes from the start of the obj
* @run main/othervm/timeout=720 -Xmx64m -verbose:gc TestBigObj
*/
// Allocate an object with a block of reference fields that starts more
// than 64K bytes from the start of the object. This is done with
@ -21,13 +43,16 @@
// block to a known object, provoke GC, then make sure the field was
// updated properly.
public class bigobj extends bigparent {
public class TestBigObj extends BigParent {
public static Object trash;
public static void main(String argv[]) {
bigobj c = new bigobj();
TestBigObj c = new TestBigObj();
Object o = c.o = new Object();
// Provoke GC so o is moved (if this is a moving collector).
for (int i = 0; i < 64 * 1024 * 1024; i++) new Object();
for (int i = 0; i < 64 * 1024 * 1024; i++) {
trash = new Object();
}
if (o != c.o) {
System.out.println("failed: o=" + o + " != c.o=" + c.o);
@ -38,7 +63,7 @@ public class bigobj extends bigparent {
Object o;
}
class bigparent {
class BigParent {
public long l00001;
public long l00002;
public long l00003;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2016, 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
@ -22,14 +22,18 @@
*/
/*
* @test TestFullGCount.java
* @test TestFullGCCount.java
* @bug 7072527
* @summary CMS: JMM GC counters overcount in some cases
* @modules java.management
* @run main/othervm -Xlog:gc TestFullGCCount
*/
import java.util.*;
import java.lang.management.*;
import java.lang.management.GarbageCollectorMXBean;
import java.lang.management.ManagementFactory;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/*
* Originally for a specific failure in CMS, this test now monitors all
@ -43,12 +47,12 @@ public class TestFullGCCount {
int iterations = 20;
boolean failed = false;
String errorMessage = "";
HashMap<String, List> counts = new HashMap<String, List>();
HashMap<String, List> counts = new HashMap<>();
// Prime the collection of count lists for all collectors.
for (int i = 0; i < collectors.size(); i++) {
GarbageCollectorMXBean collector = collectors.get(i);
counts.put(collector.getName(), new ArrayList<Long>(iterations));
counts.put(collector.getName(), new ArrayList<>(iterations));
}
// Perform some gc, record collector counts.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2016, 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
@ -22,16 +22,20 @@
*/
/*
* @test Test6581734.java
* @test TestMBeanCMS.java
* @bug 6581734
* @requires vm.gc=="ConcMarkSweep" | vm.gc=="null"
* @summary CMS Old Gen's collection usage is zero after GC which is incorrect
* @modules java.management
* @run main/othervm -Xmx512m -verbose:gc -XX:+UseConcMarkSweepGC Test6581734
* @run main/othervm -Xmx512m -verbose:gc -XX:+UseConcMarkSweepGC TestMBeanCMS
*
*/
import java.util.*;
import java.lang.management.*;
import java.lang.management.GarbageCollectorMXBean;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryPoolMXBean;
import java.util.LinkedList;
import java.util.List;
// 6581734 states that memory pool usage via the mbean is wrong
// for CMS (zero, even after a collection).
@ -41,29 +45,29 @@ import java.lang.management.*;
// -- closed as dup of 6581734 as the same fix resolves both.
public class Test6581734 {
public class TestMBeanCMS {
private String poolName = "CMS";
private String collectorName = "ConcurrentMarkSweep";
public static void main(String [] args) {
Test6581734 t = null;
TestMBeanCMS t = null;
if (args.length==2) {
t = new Test6581734(args[0], args[1]);
t = new TestMBeanCMS(args[0], args[1]);
} else {
System.out.println("Defaulting to monitor CMS pool and collector.");
t = new Test6581734();
t = new TestMBeanCMS();
}
t.run();
}
public Test6581734(String pool, String collector) {
public TestMBeanCMS(String pool, String collector) {
poolName = pool;
collectorName = collector;
}
public Test6581734() {
public TestMBeanCMS() {
}
public void run() {