hotspot/test/gc/stress/TestMultiThreadStressRSet.java
author mchernov
Thu, 14 Apr 2016 15:45:38 +0300
changeset 37498 c920466a3287
child 38152 80e5da81fb2c
permissions -rw-r--r--
8153222: [TESTBUG] Move tests in stress/gc to gc/stress Reviewed-by: dfazunen, jwilhelm
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
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    34
 * @requires vm.gc=="G1" | vm.gc=="null"
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    35
 * @requires os.maxMemory > 2G
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    36
 *
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    37
 * @summary Stress G1 Remembered Set using multiple threads
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    38
 * @library /test/lib /testlibrary
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    39
 * @build sun.hotspot.WhiteBox
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    40
 * @run main ClassFileInstaller sun.hotspot.WhiteBox
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    41
 *                              sun.hotspot.WhiteBox$WhiteBoxPermission
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    42
 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    43
 *   -XX:+UseG1GC -XX:G1SummarizeRSetStatsPeriod=1 -Xlog:gc
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    44
 *   -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
    45
 *
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    46
 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    47
 *   -XX:+UseG1GC -XX:G1SummarizeRSetStatsPeriod=100 -Xlog:gc
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    48
 *   -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
    49
 *
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    50
 * @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
    51
 *   -XX:+UseG1GC -XX:G1SummarizeRSetStatsPeriod=100 -Xlog:gc
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    52
 *   -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
    53
 */
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    54
public class TestMultiThreadStressRSet {
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
    private static final Random RND = new Random(2015 * 2016);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    57
    private static final WhiteBox WB = WhiteBox.getWhiteBox();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    58
    private static final int REF_SIZE = WB.getHeapOopSize();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    59
    private static final int REGION_SIZE = WB.g1RegionSize();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    60
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    61
    // How many regions to use for the storage
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    62
    private static final int STORAGE_REGIONS = 20;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    63
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    64
    // Size a single obj in the storage
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    65
    private static final int OBJ_SIZE = 1024;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    66
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    67
    // 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
    68
    private static final int BUFFER_YOUNG_REGIONS = 60;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    69
    private static final int BUFFER_OLD_REGIONS = 40;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    70
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    71
    // Total number of objects in the storage.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    72
    private final int N;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    73
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    74
    // The storage of byte[]
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    75
    private final List<Object> STORAGE;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    76
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    77
    // Where references to the Storage will be stored
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    78
    private final List<Object[]> BUFFER;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    79
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    80
    // The length of a buffer element.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    81
    // 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
    82
    // 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
    83
    // memory cards.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    84
    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
    85
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    86
    // Total number of objects in the young/old buffers
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    87
    private final int YOUNG;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    88
    private final int OLD;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    89
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    90
    // 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
    91
    // 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
    92
    // 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
    93
    // The first element has got the index: 'windowStart',
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    94
    // the last one: 'windowStart + windowSize - 1'
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    95
    // The window is shifting periodically.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    96
    private int windowStart;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    97
    private final int windowSize;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    98
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
    99
    // Counter of created worker threads
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   100
    private int counter = 0;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   101
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   102
    private volatile String errorMessage = null;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   103
    private volatile boolean isEnough = false;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   104
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   105
    public static void main(String args[]) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   106
        if (args.length != 2) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   107
            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
   108
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   109
        long time = Long.parseLong(args[0]);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   110
        int threads = Integer.parseInt(args[1]);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   111
        new TestMultiThreadStressRSet().test(time * 1000, threads);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   112
    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   113
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
     * Initiates test parameters, fills out the STORAGE and BUFFER.
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
    public TestMultiThreadStressRSet() {
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
        N = (REGION_SIZE - 1) * STORAGE_REGIONS / OBJ_SIZE + 1;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   120
        STORAGE = new ArrayList<>(N);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   121
        int bytes = OBJ_SIZE - 20;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   122
        for (int i = 0; i < N - 1; i++) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   123
            STORAGE.add(new byte[bytes]);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   124
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   125
        STORAGE.add(new byte[REGION_SIZE / 2 + 100]); // humongous
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   126
        windowStart = 0;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   127
        windowSize = REGION_SIZE / OBJ_SIZE;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   128
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   129
        BUFFER = new ArrayList<>();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   130
        int sizeOfBufferObject = 20 + REF_SIZE * BUF_ARR_LEN;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   131
        OLD = REGION_SIZE * BUFFER_OLD_REGIONS / sizeOfBufferObject;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   132
        YOUNG = REGION_SIZE * BUFFER_YOUNG_REGIONS / sizeOfBufferObject;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   133
        for (int i = 0; i < OLD + YOUNG; i++) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   134
            BUFFER.add(new Object[BUF_ARR_LEN]);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   135
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   136
    }
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
     * Does the testing. Steps:
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   140
     * <ul>
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   141
     * <li> starts the Shifter thread
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   142
     * <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
   143
     * of live thread under limit.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   144
     * <li> stops the Shifter thread
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   145
     * </ul>
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   146
     *
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   147
     * @param timeInMillis how long to stress
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   148
     * @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
   149
     */
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   150
    public void test(long timeInMillis, int maxThreads) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   151
        if (timeInMillis <= 0 || maxThreads <= 0) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   152
            throw new IllegalArgumentException("TEST BUG: be positive!");
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   153
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   154
        System.out.println("%% Time to work: " + timeInMillis / 1000 + "s");
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   155
        System.out.println("%% Number of threads: " + maxThreads);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   156
        long finish = System.currentTimeMillis() + timeInMillis;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   157
        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
   158
        shift.start();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   159
        for (int i = 0; i < maxThreads; i++) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   160
            new Worker(this, 100).start();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   161
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   162
        try {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   163
            while (System.currentTimeMillis() < finish && errorMessage == null) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   164
                Thread.sleep(100);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   165
            }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   166
        } catch (Throwable t) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   167
            printAllStackTraces(System.err);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   168
            t.printStackTrace(System.err);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   169
            this.errorMessage = t.getMessage();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   170
        } finally {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   171
            isEnough = true;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   172
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   173
        System.out.println("%% Total work cycles: " + counter);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   174
        if (errorMessage != null) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   175
            throw new RuntimeException(errorMessage);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   176
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   177
    }
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
     * 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
   181
     * references to the storage.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   182
     *
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   183
     * @return an Object[] from buffer.
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
    private Object[] getFromBuffer() {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   186
        int index = counter % (OLD + YOUNG);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   187
        synchronized (BUFFER) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   188
            if (index < OLD) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   189
                if (counter % 100 == (counter / 100) % 100) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   190
                    // 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
   191
                    return replaceInBuffer(index);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   192
                } else {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   193
                    return BUFFER.get(index);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   194
                }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   195
            } else {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   196
                return replaceInBuffer(index);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   197
            }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   198
        }
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
    private Object[] replaceInBuffer(int index) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   202
        Object[] objs = new Object[BUF_ARR_LEN];
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   203
        BUFFER.set(index, objs);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   204
        return objs;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   205
    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   206
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
     * 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
   209
     * 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
   210
     *
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   211
     * @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
   212
     */
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   213
    private Object getRandomObject() {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   214
        int index = (windowStart + RND.nextInt(windowSize)) % N;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   215
        return STORAGE.get(index);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   216
    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   217
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   218
    private static void printAllStackTraces(PrintStream ps) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   219
        Map<Thread, StackTraceElement[]> traces = Thread.getAllStackTraces();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   220
        for (Thread t : traces.keySet()) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   221
            ps.println(t.toString() + " " + t.getState());
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   222
            for (StackTraceElement traceElement : traces.get(t)) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   223
                ps.println("\tat " + traceElement);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   224
            }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   225
        }
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
     * 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
   230
     */
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   231
    private static class Worker extends Thread {
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
        final TestMultiThreadStressRSet boss;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   234
        final int refs; // number of refs to OldGen
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   235
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   236
        /**
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   237
         * @param boss the tests
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   238
         * @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
   239
         */
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   240
        Worker(TestMultiThreadStressRSet boss, int refsToOldGen) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   241
            this.boss = boss;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   242
            this.refs = refsToOldGen;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   243
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   244
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   245
        @Override
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   246
        public void run() {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   247
            try {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   248
                while (!boss.isEnough) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   249
                    Object[] objs = boss.getFromBuffer();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   250
                    int step = objs.length / refs;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   251
                    for (int i = 0; i < refs; i += step) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   252
                        objs[i] = boss.getRandomObject();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   253
                    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   254
                    boss.counter++;
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
            } catch (Throwable t) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   257
                t.printStackTrace(System.out);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   258
                boss.errorMessage = t.getMessage();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   259
            }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   260
        }
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
     * Periodically shifts the current STORAGE window, removing references
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   265
     * in BUFFER that refer to objects outside the window.
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   266
     */
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   267
    private static class Shifter extends Thread {
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
        final TestMultiThreadStressRSet boss;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   270
        final int sleepTime;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   271
        final int shift;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   272
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   273
        Shifter(TestMultiThreadStressRSet boss, int sleepTime, int shift) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   274
            this.boss = boss;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   275
            this.sleepTime = sleepTime;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   276
            this.shift = shift;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   277
        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   278
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   279
        @Override
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   280
        public void run() {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   281
            try {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   282
                while (!boss.isEnough) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   283
                    Thread.sleep(sleepTime);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   284
                    boss.windowStart += shift;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   285
                    for (int i = 0; i < boss.OLD; i++) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   286
                        Object[] objs = boss.BUFFER.get(i);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   287
                        for (int j = 0; j < objs.length; j++) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   288
                            objs[j] = null;
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   289
                        }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   290
                    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   291
                    if (!WB.g1InConcurrentMark()) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   292
                        System.out.println("%% start CMC");
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   293
                        WB.g1StartConcMarkCycle();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   294
                    } else {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   295
                        System.out.println("%% CMC is already in progress");
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   296
                    }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   297
                }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   298
            } catch (Throwable t) {
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   299
                t.printStackTrace(System.out);
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   300
                boss.errorMessage = t.getMessage();
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   301
            }
c920466a3287 8153222: [TESTBUG] Move tests in stress/gc to gc/stress
mchernov
parents:
diff changeset
   302
        }
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