819N/A/*
1472N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
819N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
819N/A *
819N/A * This code is free software; you can redistribute it and/or modify it
819N/A * under the terms of the GNU General Public License version 2 only, as
819N/A * published by the Free Software Foundation.
819N/A *
819N/A * This code is distributed in the hope that it will be useful, but WITHOUT
819N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
819N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
819N/A * version 2 for more details (a copy is included in the LICENSE file that
819N/A * accompanied this code).
819N/A *
819N/A * You should have received a copy of the GNU General Public License version
819N/A * 2 along with this work; if not, write to the Free Software Foundation,
819N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
819N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
819N/A *
819N/A */
819N/A
819N/A/**
819N/A * @test
819N/A * @bug 6849574
819N/A * @summary VM crash using NonBlockingHashMap (high_scale_lib)
819N/A *
819N/A * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+VerifyBeforeGC Test
819N/A */
819N/A
819N/Aimport java.util.concurrent.atomic.*;
819N/A
819N/Apublic class Test extends Thread {
819N/A
819N/A public static void main(String[] args) {
819N/A AtomicReferenceArray a = new AtomicReferenceArray(10000);
819N/A for (int i = 0; i < 100000; i++) {
819N/A a.getAndSet(9999, new Object());
819N/A if (i > 99990) System.gc();
819N/A }
819N/A }
819N/A}