kvn@1293: /* trims@1907: * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. kvn@1293: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. kvn@1293: * kvn@1293: * This code is free software; you can redistribute it and/or modify it kvn@1293: * under the terms of the GNU General Public License version 2 only, as kvn@1293: * published by the Free Software Foundation. kvn@1293: * kvn@1293: * This code is distributed in the hope that it will be useful, but WITHOUT kvn@1293: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or kvn@1293: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License kvn@1293: * version 2 for more details (a copy is included in the LICENSE file that kvn@1293: * accompanied this code). kvn@1293: * kvn@1293: * You should have received a copy of the GNU General Public License version kvn@1293: * 2 along with this work; if not, write to the Free Software Foundation, kvn@1293: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. kvn@1293: * trims@1907: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA trims@1907: * or visit www.oracle.com if you need additional information or have any trims@1907: * questions. kvn@1293: * kvn@1293: */ kvn@1293: kvn@1293: /** kvn@1293: * @test kvn@1293: * @bug 6826736 kvn@1293: * @summary CMS: core dump with -XX:+UseCompressedOops kvn@1293: * anoll@6315: * @run main/othervm/timeout=600 -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:+ScavengeALot -XX:+UseCompressedOops -XX:HeapBaseMinAddress=32g -XX:CompileThreshold=100 -XX:CompileOnly=Test.test -XX:-BlockLayoutRotateLoops -XX:LoopUnrollLimit=0 -Xmx256m -XX:ParallelGCThreads=4 Test kvn@1293: */ kvn@1293: kvn@1293: public class Test { kvn@1293: int[] arr; kvn@1293: int[] arr2; kvn@1293: int test(int r) { kvn@1293: for (int i = 0; i < 100; i++) { kvn@1293: for (int j = i; j < 100; j++) { kvn@1293: int a = 0; kvn@1293: for (long k = 0; k < 100; k++) { kvn@1293: a += k; kvn@1293: } kvn@1293: if (arr != null) kvn@1293: a = arr[j]; kvn@1293: r += a; kvn@1293: } kvn@1293: } kvn@1293: return r; kvn@1293: } kvn@1293: kvn@1293: public static void main(String[] args) { kvn@1293: int r = 0; kvn@1293: Test t = new Test(); kvn@1293: for (int i = 0; i < 100; i++) { kvn@1293: t.arr = new int[100]; kvn@1293: r = t.test(r); kvn@1293: } kvn@1293: System.out.println("Warmup 1 is done."); kvn@1293: for (int i = 0; i < 100; i++) { kvn@1293: t.arr = null; kvn@1293: r = t.test(r); kvn@1293: } kvn@1293: System.out.println("Warmup 2 is done."); kvn@1293: for (int i = 0; i < 100; i++) { kvn@1293: t.arr = new int[100]; kvn@1293: r = t.test(r); kvn@1293: } kvn@1293: System.out.println("Warmup is done."); kvn@1293: for (int i = 0; i < 100; i++) { kvn@1293: t.arr = new int[1000000]; kvn@1293: t.arr = null; kvn@1293: r = t.test(r); kvn@1293: } kvn@1293: } kvn@1293: }