hotspot/test/gc/parallelScavenge/AdaptiveGCBoundary.java
author duke
Wed, 05 Jul 2017 20:15:13 +0200
changeset 28462 8327024a9955
parent 18443 ca4b3427b7c7
child 29678 dd2f3932c21e
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18443
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
     1
/*
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
     4
 *
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
     7
 * published by the Free Software Foundation.
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
     8
 *
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    13
 * accompanied this code).
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    14
 *
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    18
 *
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    21
 * questions.
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    22
 */
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    23
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    24
/**
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    25
 * @test AdaptiveGCBoundary
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    26
 * @summary UseAdaptiveGCBoundary is broken
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    27
 * @bug 8014546
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    28
 * @key gc
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    29
 * @key regression
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    30
 * @library /testlibrary
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    31
 * @run main/othervm AdaptiveGCBoundary
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    32
 * @author jon.masamitsu@oracle.com
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    33
 */
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    34
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    35
import com.oracle.java.testlibrary.*;
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    36
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    37
public class AdaptiveGCBoundary {
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    38
  public static void main(String args[]) throws Exception {
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    39
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    40
    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    41
      "-showversion",
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    42
      "-XX:+UseParallelGC",
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    43
      "-XX:+UseAdaptiveGCBoundary",
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    44
      "-XX:+PrintCommandLineFlags",
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    45
      SystemGCCaller.class.getName()
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    46
      );
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    47
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    48
    OutputAnalyzer output = new OutputAnalyzer(pb.start());
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    49
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    50
    output.shouldContain("+UseAdaptiveGCBoundary");
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    51
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    52
    output.shouldNotContain("error");
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    53
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    54
    output.shouldHaveExitValue(0);
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    55
  }
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    56
  static class SystemGCCaller {
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    57
    public static void main(String [] args) {
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    58
      System.gc();
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    59
    }
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    60
  }
ca4b3427b7c7 8014851: UseAdaptiveGCBoundary is broken
jmasa
parents:
diff changeset
    61
}