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 TestPLABSizeBounds 26 * @bug 8134857 27 * @summary Regression test to ensure that G1 supports PLAB sizes of half a region size. 28 * @requires vm.gc.G1 29 * @key gc 30 * @library /testlibrary 31 * @modules java.base/jdk.internal.misc 32 * java.management 33 */ 34 35 import java.util.ArrayList; 36 37 import jdk.test.lib.OutputAnalyzer; 38 import jdk.test.lib.Platform; 39 import jdk.test.lib.ProcessTools; 40 41 public class TestPLABSizeBounds { 42 43 public static final int M = 1024 * 1024; 44 45 /** 46 * Starts the VM with the given region size and the given PLAB size arguments. The VM start should 47 * succeed if shouldSucceed is true, otherwise it should fail. 48 * 49 * @param regionSize The region size the VM should be started with in bytes. 50 * @param plabSize The young and old gen PLAB sizes the VM should be started with in machine words. 51 * @param shouldSucceed The expected result of the VM invocation. 52 */ 53 public static void runTest(int regionSize, int plabSize, boolean shouldSucceed) throws Exception { 54 ArrayList<String> testArguments = new ArrayList<String>(); 55 56 testArguments.add("-XX:+UseG1GC"); 57 testArguments.add("-Xmx256M"); 58 testArguments.add("-XX:G1HeapRegionSize=" + regionSize); 59 testArguments.add("-XX:YoungPLABSize=" + plabSize); | 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 TestPLABSizeBounds 26 * @bug 8134857 27 * @summary Regression test to ensure that G1 supports PLAB sizes of half a region size. 28 * @requires vm.gc.G1 29 * @key gc 30 * @library /test/lib 31 * @modules java.base/jdk.internal.misc 32 * java.management 33 */ 34 35 import java.util.ArrayList; 36 37 import jdk.test.lib.Platform; 38 import jdk.test.lib.process.OutputAnalyzer; 39 import jdk.test.lib.process.ProcessTools; 40 41 public class TestPLABSizeBounds { 42 43 public static final int M = 1024 * 1024; 44 45 /** 46 * Starts the VM with the given region size and the given PLAB size arguments. The VM start should 47 * succeed if shouldSucceed is true, otherwise it should fail. 48 * 49 * @param regionSize The region size the VM should be started with in bytes. 50 * @param plabSize The young and old gen PLAB sizes the VM should be started with in machine words. 51 * @param shouldSucceed The expected result of the VM invocation. 52 */ 53 public static void runTest(int regionSize, int plabSize, boolean shouldSucceed) throws Exception { 54 ArrayList<String> testArguments = new ArrayList<String>(); 55 56 testArguments.add("-XX:+UseG1GC"); 57 testArguments.add("-Xmx256M"); 58 testArguments.add("-XX:G1HeapRegionSize=" + regionSize); 59 testArguments.add("-XX:YoungPLABSize=" + plabSize); |