hotspot/test/gc/stress/TestMultiThreadStressRSet.java
author ctornqvi
Fri, 19 Aug 2016 10:06:30 -0400
changeset 40631 ed82623d7831
parent 39414 4adf52148100
permissions -rw-r--r--
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder Reviewed-by: coleenp, gtriantafill, mseledtsov, iignatyev, dholmes, dsamersoff
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37498
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
     1
/*
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
     4
 *
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
     7
 * published by the Free Software Foundation.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
     8
 *
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    13
 * accompanied this code).
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    14
 *
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    18
 *
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    21
 * questions.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    22
 */
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    23
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    24
import java.io.PrintStream;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    25
import java.util.ArrayList;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    26
import java.util.List;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    27
import java.util.Map;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    28
import java.util.Random;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    29
import sun.hotspot.WhiteBox;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    30
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    31
/*
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    32
 * @test TestMultiThreadStressRSet.java
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    33
 * @key stress
39414
4adf52148100 8160088: update hotspot tests depending on GC to use @requires vm.gc.X
dfazunen
parents: 38930
diff changeset
    34
 * @requires vm.gc.G1
37498
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    35
 * @requires os.maxMemory > 2G
38930
469cfb0d7eb3 8157954: [TESTBUG] G1 tests fail with defined MaxGCPauseMillis
mchernov
parents: 38152
diff changeset
    36
 * @requires vm.opt.MaxGCPauseMillis == "null"
37498
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    37
 *
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    38
 * @summary Stress G1 Remembered Set using multiple threads
38152
80e5da81fb2c 8154258: [TESTBUG] Various serviceability tests fail compilation
dsamersoff
parents: 37498
diff changeset
    39
 * @modules java.base/jdk.internal.misc
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 39414
diff changeset
    40
 * @library /test/lib
37498
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    41
 * @build sun.hotspot.WhiteBox
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    42
 * @run main ClassFileInstaller sun.hotspot.WhiteBox
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    43
 *                              sun.hotspot.WhiteBox$WhiteBoxPermission
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    44
 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    45
 *   -XX:+UseG1GC -XX:G1SummarizeRSetStatsPeriod=1 -Xlog:gc
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    46
 *   -Xmx500m -XX:G1HeapRegionSize=1m -XX:MaxGCPauseMillis=1000 TestMultiThreadStressRSet 10 4
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    47
 *
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    48
 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    49
 *   -XX:+UseG1GC -XX:G1SummarizeRSetStatsPeriod=100 -Xlog:gc
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    50
 *   -Xmx1G -XX:G1HeapRegionSize=8m -XX:MaxGCPauseMillis=1000 TestMultiThreadStressRSet 60 16
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    51
 *
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    52
 * @run main/othervm/timeout=700 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    53
 *   -XX:+UseG1GC -XX:G1SummarizeRSetStatsPeriod=100 -Xlog:gc
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    54
 *   -Xmx500m -XX:G1HeapRegionSize=1m -XX:MaxGCPauseMillis=1000 TestMultiThreadStressRSet 600 32
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    55
 */
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    56
public class TestMultiThreadStressRSet {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    57
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    58
    private static final Random RND = new Random(2015 * 2016);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    59
    private static final WhiteBox WB = WhiteBox.getWhiteBox();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    60
    private static final int REF_SIZE = WB.getHeapOopSize();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    61
    private static final int REGION_SIZE = WB.g1RegionSize();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    62
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    63
    // How many regions to use for the storage
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    64
    private static final int STORAGE_REGIONS = 20;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    65
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    66
    // Size a single obj in the storage
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    67
    private static final int OBJ_SIZE = 1024;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    68
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    69
    // How many regions of young/old gen to use in the BUFFER
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    70
    private static final int BUFFER_YOUNG_REGIONS = 60;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    71
    private static final int BUFFER_OLD_REGIONS = 40;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    72
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    73
    // Total number of objects in the storage.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    74
    private final int N;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    75
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    76
    // The storage of byte[]
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    77
    private final List<Object> STORAGE;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    78
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    79
    // Where references to the Storage will be stored
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    80
    private final List<Object[]> BUFFER;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    81
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    82
    // The length of a buffer element.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    83
    // RSet deals with "cards" (areas of 512 bytes), not with single refs
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    84
    // So, to affect the RSet the BUFFER refs should be allocated in different
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    85
    // memory cards.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    86
    private final int BUF_ARR_LEN = 100 * (512 / REF_SIZE);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    87
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    88
    // Total number of objects in the young/old buffers
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    89
    private final int YOUNG;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    90
    private final int OLD;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    91
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    92
    // To cause Remembered Sets change their coarse level the test uses a window
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    93
    // within STORAGE. All the BUFFER elements refer to only STORAGE objects
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    94
    // from the current window. The window is defined by a range.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    95
    // The first element has got the index: 'windowStart',
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    96
    // the last one: 'windowStart + windowSize - 1'
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    97
    // The window is shifting periodically.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    98
    private int windowStart;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    99
    private final int windowSize;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   100
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   101
    // Counter of created worker threads
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   102
    private int counter = 0;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   103
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   104
    private volatile String errorMessage = null;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   105
    private volatile boolean isEnough = false;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   106
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   107
    public static void main(String args[]) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   108
        if (args.length != 2) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   109
            throw new IllegalArgumentException("TEST BUG: wrong arg count " + args.length);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   110
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   111
        long time = Long.parseLong(args[0]);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   112
        int threads = Integer.parseInt(args[1]);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   113
        new TestMultiThreadStressRSet().test(time * 1000, threads);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   114
    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   115
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   116
    /**
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   117
     * Initiates test parameters, fills out the STORAGE and BUFFER.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   118
     */
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   119
    public TestMultiThreadStressRSet() {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   120
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   121
        N = (REGION_SIZE - 1) * STORAGE_REGIONS / OBJ_SIZE + 1;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   122
        STORAGE = new ArrayList<>(N);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   123
        int bytes = OBJ_SIZE - 20;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   124
        for (int i = 0; i < N - 1; i++) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   125
            STORAGE.add(new byte[bytes]);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   126
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   127
        STORAGE.add(new byte[REGION_SIZE / 2 + 100]); // humongous
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   128
        windowStart = 0;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   129
        windowSize = REGION_SIZE / OBJ_SIZE;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   130
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   131
        BUFFER = new ArrayList<>();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   132
        int sizeOfBufferObject = 20 + REF_SIZE * BUF_ARR_LEN;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   133
        OLD = REGION_SIZE * BUFFER_OLD_REGIONS / sizeOfBufferObject;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   134
        YOUNG = REGION_SIZE * BUFFER_YOUNG_REGIONS / sizeOfBufferObject;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   135
        for (int i = 0; i < OLD + YOUNG; i++) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   136
            BUFFER.add(new Object[BUF_ARR_LEN]);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   137
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   138
    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   139
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   140
    /**
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   141
     * Does the testing. Steps:
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   142
     * <ul>
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   143
     * <li> starts the Shifter thread
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   144
     * <li> during the given time starts new Worker threads, keeping the number
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   145
     * of live thread under limit.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   146
     * <li> stops the Shifter thread
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   147
     * </ul>
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   148
     *
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   149
     * @param timeInMillis how long to stress
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   150
     * @param maxThreads the maximum number of Worker thread working together.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   151
     */
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   152
    public void test(long timeInMillis, int maxThreads) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   153
        if (timeInMillis <= 0 || maxThreads <= 0) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   154
            throw new IllegalArgumentException("TEST BUG: be positive!");
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   155
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   156
        System.out.println("%% Time to work: " + timeInMillis / 1000 + "s");
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   157
        System.out.println("%% Number of threads: " + maxThreads);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   158
        long finish = System.currentTimeMillis() + timeInMillis;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   159
        Shifter shift = new Shifter(this, 1000, (int) (windowSize * 0.9));
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   160
        shift.start();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   161
        for (int i = 0; i < maxThreads; i++) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   162
            new Worker(this, 100).start();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   163
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   164
        try {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   165
            while (System.currentTimeMillis() < finish && errorMessage == null) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   166
                Thread.sleep(100);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   167
            }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   168
        } catch (Throwable t) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   169
            printAllStackTraces(System.err);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   170
            t.printStackTrace(System.err);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   171
            this.errorMessage = t.getMessage();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   172
        } finally {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   173
            isEnough = true;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   174
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   175
        System.out.println("%% Total work cycles: " + counter);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   176
        if (errorMessage != null) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   177
            throw new RuntimeException(errorMessage);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   178
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   179
    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   180
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   181
    /**
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   182
     * Returns an element from from the BUFFER (an object array) to keep
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   183
     * references to the storage.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   184
     *
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   185
     * @return an Object[] from buffer.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   186
     */
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   187
    private Object[] getFromBuffer() {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   188
        int index = counter % (OLD + YOUNG);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   189
        synchronized (BUFFER) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   190
            if (index < OLD) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   191
                if (counter % 100 == (counter / 100) % 100) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   192
                    // need to generate garbage in the old gen to provoke mixed GC
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   193
                    return replaceInBuffer(index);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   194
                } else {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   195
                    return BUFFER.get(index);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   196
                }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   197
            } else {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   198
                return replaceInBuffer(index);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   199
            }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   200
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   201
    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   202
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   203
    private Object[] replaceInBuffer(int index) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   204
        Object[] objs = new Object[BUF_ARR_LEN];
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   205
        BUFFER.set(index, objs);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   206
        return objs;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   207
    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   208
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   209
    /**
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   210
     * Returns a random object from the current window within the storage.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   211
     * A storage element with index from windowStart to windowStart+windowSize.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   212
     *
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   213
     * @return a random element from the current window within the storage.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   214
     */
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   215
    private Object getRandomObject() {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   216
        int index = (windowStart + RND.nextInt(windowSize)) % N;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   217
        return STORAGE.get(index);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   218
    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   219
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   220
    private static void printAllStackTraces(PrintStream ps) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   221
        Map<Thread, StackTraceElement[]> traces = Thread.getAllStackTraces();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   222
        for (Thread t : traces.keySet()) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   223
            ps.println(t.toString() + " " + t.getState());
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   224
            for (StackTraceElement traceElement : traces.get(t)) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   225
                ps.println("\tat " + traceElement);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   226
            }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   227
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   228
    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   229
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   230
    /**
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   231
     * Thread to create a number of references from BUFFER to STORAGE.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   232
     */
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   233
    private static class Worker extends Thread {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   234
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   235
        final TestMultiThreadStressRSet boss;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   236
        final int refs; // number of refs to OldGen
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   237
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   238
        /**
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   239
         * @param boss the tests
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   240
         * @param refsToOldGen how many references to the OldGen to create
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   241
         */
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   242
        Worker(TestMultiThreadStressRSet boss, int refsToOldGen) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   243
            this.boss = boss;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   244
            this.refs = refsToOldGen;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   245
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   246
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   247
        @Override
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   248
        public void run() {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   249
            try {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   250
                while (!boss.isEnough) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   251
                    Object[] objs = boss.getFromBuffer();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   252
                    int step = objs.length / refs;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   253
                    for (int i = 0; i < refs; i += step) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   254
                        objs[i] = boss.getRandomObject();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   255
                    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   256
                    boss.counter++;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   257
                }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   258
            } catch (Throwable t) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   259
                t.printStackTrace(System.out);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   260
                boss.errorMessage = t.getMessage();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   261
            }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   262
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   263
    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   264
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   265
    /**
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   266
     * Periodically shifts the current STORAGE window, removing references
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   267
     * in BUFFER that refer to objects outside the window.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   268
     */
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   269
    private static class Shifter extends Thread {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   270
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   271
        final TestMultiThreadStressRSet boss;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   272
        final int sleepTime;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   273
        final int shift;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   274
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   275
        Shifter(TestMultiThreadStressRSet boss, int sleepTime, int shift) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   276
            this.boss = boss;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   277
            this.sleepTime = sleepTime;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   278
            this.shift = shift;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   279
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   280
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   281
        @Override
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   282
        public void run() {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   283
            try {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   284
                while (!boss.isEnough) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   285
                    Thread.sleep(sleepTime);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   286
                    boss.windowStart += shift;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   287
                    for (int i = 0; i < boss.OLD; i++) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   288
                        Object[] objs = boss.BUFFER.get(i);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   289
                        for (int j = 0; j < objs.length; j++) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   290
                            objs[j] = null;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   291
                        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   292
                    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   293
                    if (!WB.g1InConcurrentMark()) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   294
                        System.out.println("%% start CMC");
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   295
                        WB.g1StartConcMarkCycle();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   296
                    } else {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   297
                        System.out.println("%% CMC is already in progress");
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   298
                    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   299
                }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   300
            } catch (Throwable t) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   301
                t.printStackTrace(System.out);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   302
                boss.errorMessage = t.getMessage();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   303
            }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   304
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   305
    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   306
}
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   307