Mon, 11 Apr 2016 14:58:21 -0700
Merge
.hgtags | file | annotate | diff | comparison | revisions | |
test/gc/8000311/Test8000311.java | file | annotate | diff | comparison | revisions | |
test/gc/TestG1ZeroPGCTJcmdThreadPrint.java | file | annotate | diff | comparison | revisions |
1.1 --- a/.hgtags Tue Apr 05 08:55:39 2016 -0700 1.2 +++ b/.hgtags Mon Apr 11 14:58:21 2016 -0700 1.3 @@ -850,3 +850,4 @@ 1.4 d6c92b9e192ef97305a699e868387d55821c81ad jdk8u102-b00 1.5 d6c92b9e192ef97305a699e868387d55821c81ad jdk8u82-b00 1.6 516a64e6d7c2dc29fd932bf3b8313e560a01bcd0 jdk8u102-b01 1.7 +83dc7e55f71596e6e76fabfa56b6008e070ff44c jdk8u102-b02
2.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.cpp Tue Apr 05 08:55:39 2016 -0700 2.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp Mon Apr 11 14:58:21 2016 -0700 2.3 @@ -794,7 +794,9 @@ 2.4 "in region "HR_FORMAT, 2.5 (void*) obj, 2.6 HR_FORMAT_PARAMS(to)); 2.7 - obj->print_on(gclog_or_tty); 2.8 + if (obj->is_oop()) { 2.9 + obj->print_on(gclog_or_tty); 2.10 + } 2.11 gclog_or_tty->print_cr("Obj head CTE = %d, field CTE = %d.", 2.12 cv_obj, cv_field); 2.13 gclog_or_tty->print_cr("----------");
3.1 --- a/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp Tue Apr 05 08:55:39 2016 -0700 3.2 +++ b/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp Mon Apr 11 14:58:21 2016 -0700 3.3 @@ -193,8 +193,9 @@ 3.4 (!FLAG_IS_DEFAULT(ParallelGCThreads) && !ForceDynamicNumberOfGCThreads)) { 3.5 new_active_workers = total_workers; 3.6 } else { 3.7 + uintx min_workers = (total_workers == 1) ? 1 : 2; 3.8 new_active_workers = calc_default_active_workers(total_workers, 3.9 - 2, /* Minimum number of workers */ 3.10 + min_workers, 3.11 active_workers, 3.12 application_workers); 3.13 }
4.1 --- a/src/share/vm/runtime/arguments.cpp Tue Apr 05 08:55:39 2016 -0700 4.2 +++ b/src/share/vm/runtime/arguments.cpp Mon Apr 11 14:58:21 2016 -0700 4.3 @@ -1675,9 +1675,8 @@ 4.4 FLAG_SET_DEFAULT(ParallelGCThreads, 4.5 Abstract_VM_Version::parallel_worker_threads()); 4.6 if (ParallelGCThreads == 0) { 4.7 - FLAG_SET_DEFAULT(ParallelGCThreads, 4.8 - Abstract_VM_Version::parallel_worker_threads()); 4.9 - } 4.10 + vm_exit_during_initialization("The flag -XX:+UseG1GC can not be combined with -XX:ParallelGCThreads=0", NULL); 4.11 + } 4.12 4.13 #if INCLUDE_ALL_GCS 4.14 if (G1ConcRefinementThreads == 0) {
5.1 --- a/test/TEST.groups Tue Apr 05 08:55:39 2016 -0700 5.2 +++ b/test/TEST.groups Mon Apr 11 14:58:21 2016 -0700 5.3 @@ -61,7 +61,6 @@ 5.4 # can be resolved in some cases by using tools from the compile-jdk. 5.5 # 5.6 needs_jdk = \ 5.7 - gc/TestG1ZeroPGCTJcmdThreadPrint.java \ 5.8 gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java \ 5.9 gc/metaspace/TestMetaspacePerfCounters.java \ 5.10 gc/metaspace/TestPerfCountersAndMemoryPools.java \ 5.11 @@ -216,6 +215,7 @@ 5.12 runtime/NMT \ 5.13 gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java \ 5.14 gc/class_unloading/TestG1ClassUnloadingHWM.java \ 5.15 + gc/ergonomics/TestDynamicNumberOfGCThreads.java \ 5.16 gc/g1/TestRegionAlignment.java \ 5.17 gc/g1/TestShrinkToOneRegion.java \ 5.18 gc/metaspace/G1AddMetaspaceDependency.java \
6.1 --- a/test/gc/8000311/Test8000311.java Tue Apr 05 08:55:39 2016 -0700 6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 6.3 @@ -1,42 +0,0 @@ 6.4 -/* 6.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 6.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 6.7 - * 6.8 - * This code is free software; you can redistribute it and/or modify it 6.9 - * under the terms of the GNU General Public License version 2 only, as 6.10 - * published by the Free Software Foundation. 6.11 - * 6.12 - * This code is distributed in the hope that it will be useful, but WITHOUT 6.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 6.14 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 6.15 - * version 2 for more details (a copy is included in the LICENSE file that 6.16 - * accompanied this code). 6.17 - * 6.18 - * You should have received a copy of the GNU General Public License version 6.19 - * 2 along with this work; if not, write to the Free Software Foundation, 6.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 6.21 - * 6.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 6.23 - * or visit www.oracle.com if you need additional information or have any 6.24 - * questions. 6.25 - */ 6.26 - 6.27 -/** 6.28 - * @test Test8000311 6.29 - * @key gc 6.30 - * @bug 8000311 6.31 - * @summary G1: ParallelGCThreads==0 broken 6.32 - * @run main/othervm -XX:+UseG1GC -XX:ParallelGCThreads=0 -XX:+ResizePLAB -XX:+ExplicitGCInvokesConcurrent Test8000311 6.33 - * @author filipp.zhinkin@oracle.com 6.34 - */ 6.35 - 6.36 -import java.util.*; 6.37 - 6.38 -public class Test8000311 { 6.39 - public static void main(String args[]) { 6.40 - for(int i = 0; i<100; i++) { 6.41 - byte[] garbage = new byte[1000]; 6.42 - System.gc(); 6.43 - } 6.44 - } 6.45 -}
7.1 --- a/test/gc/TestG1ZeroPGCTJcmdThreadPrint.java Tue Apr 05 08:55:39 2016 -0700 7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 7.3 @@ -1,54 +0,0 @@ 7.4 -/* 7.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 7.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 7.7 - * 7.8 - * This code is free software; you can redistribute it and/or modify it 7.9 - * under the terms of the GNU General Public License version 2 only, as 7.10 - * published by the Free Software Foundation. 7.11 - * 7.12 - * This code is distributed in the hope that it will be useful, but WITHOUT 7.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 7.14 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 7.15 - * version 2 for more details (a copy is included in the LICENSE file that 7.16 - * accompanied this code). 7.17 - * 7.18 - * You should have received a copy of the GNU General Public License version 7.19 - * 2 along with this work; if not, write to the Free Software Foundation, 7.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 7.21 - * 7.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 7.23 - * or visit www.oracle.com if you need additional information or have any 7.24 - * questions. 7.25 - */ 7.26 - 7.27 -/* @test TestG1ZeroPGCTJcmdThreadPrint 7.28 - * @key gc 7.29 - * @bug 8005875 7.30 - * @summary Use jcmd to generate a thread dump of a Java program being run with PGCT=0 to verify 8005875 7.31 - * @library /testlibrary 7.32 - * @run main/othervm -XX:+UseG1GC -XX:ParallelGCThreads=0 -XX:+IgnoreUnrecognizedVMOptions TestG1ZeroPGCTJcmdThreadPrint 7.33 - */ 7.34 - 7.35 -import com.oracle.java.testlibrary.*; 7.36 - 7.37 -public class TestG1ZeroPGCTJcmdThreadPrint { 7.38 - public static void main(String args[]) throws Exception { 7.39 - 7.40 - // Grab the pid from the current java process 7.41 - String pid = Integer.toString(ProcessTools.getProcessId()); 7.42 - 7.43 - // Create a ProcessBuilder 7.44 - ProcessBuilder pb = new ProcessBuilder(); 7.45 - 7.46 - // Run jcmd <pid> Thread.print 7.47 - pb.command(JDKToolFinder.getJDKTool("jcmd"), pid, "Thread.print"); 7.48 - 7.49 - OutputAnalyzer output = new OutputAnalyzer(pb.start()); 7.50 - 7.51 - // There shouldn't be a work gang for concurrent marking. 7.52 - output.shouldNotContain("G1 Parallel Marking Threads"); 7.53 - 7.54 - // Make sure we didn't crash 7.55 - output.shouldHaveExitValue(0); 7.56 - } 7.57 -}
8.1 --- a/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java Tue Apr 05 08:55:39 2016 -0700 8.2 +++ b/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java Mon Apr 11 14:58:21 2016 -0700 8.3 @@ -44,14 +44,24 @@ 8.4 } 8.5 8.6 private static void verifyDynamicNumberOfGCThreads(OutputAnalyzer output) { 8.7 + output.shouldHaveExitValue(0); // test should run succesfully 8.8 output.shouldContain("new_active_workers"); 8.9 - output.shouldHaveExitValue(0); 8.10 } 8.11 8.12 private static void testDynamicNumberOfGCThreads(String gcFlag) throws Exception { 8.13 // UseDynamicNumberOfGCThreads and TraceDynamicGCThreads enabled 8.14 - ProcessBuilder pb_enabled = 8.15 - ProcessTools.createJavaProcessBuilder("-XX:+" + gcFlag, "-Xmx10M", "-XX:+PrintGCDetails", "-XX:+UseDynamicNumberOfGCThreads", "-XX:+TraceDynamicGCThreads", GCTest.class.getName()); 8.16 + String[] baseArgs = {"-XX:+" + gcFlag, "-Xmx10M", "-XX:+PrintGCDetails", "-XX:+UseDynamicNumberOfGCThreads", "-XX:+TraceDynamicGCThreads", GCTest.class.getName()}; 8.17 + 8.18 + // Base test with gc and +UseDynamicNumberOfGCThreads: 8.19 + ProcessBuilder pb_enabled = ProcessTools.createJavaProcessBuilder(baseArgs); 8.20 + verifyDynamicNumberOfGCThreads(new OutputAnalyzer(pb_enabled.start())); 8.21 + 8.22 + // Ensure it also works on uniprocessors or if user specifies -XX:ParallelGCThreads=1: 8.23 + String[] extraArgs = {"-XX:+UnlockDiagnosticVMOptions", "-XX:+ForceDynamicNumberOfGCThreads", "-XX:ParallelGCThreads=1"}; 8.24 + String[] finalArgs = new String[baseArgs.length + extraArgs.length]; 8.25 + System.arraycopy(extraArgs, 0, finalArgs, 0, extraArgs.length); 8.26 + System.arraycopy(baseArgs, 0, finalArgs, extraArgs.length, baseArgs.length); 8.27 + pb_enabled = ProcessTools.createJavaProcessBuilder(finalArgs); 8.28 verifyDynamicNumberOfGCThreads(new OutputAnalyzer(pb_enabled.start())); 8.29 } 8.30