TestPromotionLABLargeSurvivorAlignment.java revision 10706:969af18f3b36
1/* 2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 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 8060463 27 * @summary Verify that objects promoted from eden space to survivor space 28 * with large values for SurvivorAlignmentInBytes succeed. 29 * @requires vm.opt.ExplicitGCInvokesConcurrent != true 30 * @run main/othervm -Xmx128m 31 * -XX:+UnlockExperimentalVMOptions 32 * -XX:SurvivorAlignmentInBytes=8 -XX:SurvivorRatio=1 33 * -XX:-ExplicitGCInvokesConcurrent -XX:-ResizePLAB 34 * TestPromotionLABLargeSurvivorAlignment 35 * @run main/othervm -Xmx128m 36 * -XX:+UnlockExperimentalVMOptions 37 * -XX:SurvivorAlignmentInBytes=16 -XX:SurvivorRatio=1 38 * -XX:-ExplicitGCInvokesConcurrent -XX:-ResizePLAB 39 * TestPromotionLABLargeSurvivorAlignment 40 * @run main/othervm -Xmx128m 41 * -XX:+UnlockExperimentalVMOptions 42 * -XX:SurvivorAlignmentInBytes=512 -XX:SurvivorRatio=1 43 * -XX:-ExplicitGCInvokesConcurrent -XX:-ResizePLAB 44 * TestPromotionLABLargeSurvivorAlignment 45 * @run main/othervm -Xmx128m 46 * -XX:+UnlockExperimentalVMOptions 47 * -XX:SurvivorAlignmentInBytes=1k -XX:SurvivorRatio=1 48 * -XX:-ExplicitGCInvokesConcurrent -XX:-ResizePLAB 49 * TestPromotionLABLargeSurvivorAlignment 50 * @run main/othervm -Xmx128m 51 * -XX:+UnlockExperimentalVMOptions 52 * -XX:SurvivorAlignmentInBytes=4k -XX:SurvivorRatio=1 53 * -XX:-ExplicitGCInvokesConcurrent -XX:-ResizePLAB 54 * TestPromotionLABLargeSurvivorAlignment 55 * @run main/othervm -Xmx128m 56 * -XX:+UnlockExperimentalVMOptions 57 * -XX:SurvivorAlignmentInBytes=16k -XX:SurvivorRatio=1 58 * -XX:-ExplicitGCInvokesConcurrent -XX:-ResizePLAB 59 * TestPromotionLABLargeSurvivorAlignment 60 */ 61public class TestPromotionLABLargeSurvivorAlignment { 62 public static void main(String args[]) { 63 Object garbage[] = new Object[1000000]; 64 for (int i = 0; i < garbage.length; i++) { 65 garbage[i] = new byte[0]; 66 } 67 for (int i = 0; i < 2; i++) { 68 System.gc(); 69 } 70 } 71} 72 73