< prev index next >

test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java

Print this page


   1 /*
   2  * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */


  53         output.shouldHaveExitValue(0);
  54     }
  55 
  56     public static void smallHeapTestWith3G() throws Exception {
  57         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  58             "-XX:+UnlockDiagnosticVMOptions",
  59             "-XX:CompressedClassSpaceSize=3g",
  60             "-Xmx128m",
  61             "-Xlog:gc+metaspace=trace",
  62             "-Xshare:off",
  63             "-Xlog:cds=trace",
  64             "-XX:+VerifyBeforeGC", "-version");
  65         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  66         output.shouldContain("Narrow klass base: 0x0000000000000000, Narrow klass shift: 3");
  67         output.shouldHaveExitValue(0);
  68     }
  69 
  70     public static void largeHeapTest() throws Exception {
  71         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  72             "-XX:+UnlockDiagnosticVMOptions",

  73             "-Xmx30g",
  74             "-XX:-UseAOT", // AOT explicitly set klass shift to 3.
  75             "-Xlog:gc+metaspace=trace",
  76             "-Xshare:off",
  77             "-Xlog:cds=trace",
  78             "-XX:+VerifyBeforeGC", "-version");
  79         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  80         output.shouldNotContain("Narrow klass base: 0x0000000000000000");
  81         output.shouldContain("Narrow klass shift: 0");
  82         output.shouldHaveExitValue(0);
  83     }
  84 
  85     public static void largePagesTest() throws Exception {
  86         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  87             "-XX:+UnlockDiagnosticVMOptions",
  88             "-Xmx128m",
  89             "-XX:+UseLargePages",
  90             "-Xlog:gc+metaspace=trace",
  91             "-XX:+VerifyBeforeGC", "-version");
  92         OutputAnalyzer output = new OutputAnalyzer(pb.start());


   1 /*
   2  * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */


  53         output.shouldHaveExitValue(0);
  54     }
  55 
  56     public static void smallHeapTestWith3G() throws Exception {
  57         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  58             "-XX:+UnlockDiagnosticVMOptions",
  59             "-XX:CompressedClassSpaceSize=3g",
  60             "-Xmx128m",
  61             "-Xlog:gc+metaspace=trace",
  62             "-Xshare:off",
  63             "-Xlog:cds=trace",
  64             "-XX:+VerifyBeforeGC", "-version");
  65         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  66         output.shouldContain("Narrow klass base: 0x0000000000000000, Narrow klass shift: 3");
  67         output.shouldHaveExitValue(0);
  68     }
  69 
  70     public static void largeHeapTest() throws Exception {
  71         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  72             "-XX:+UnlockDiagnosticVMOptions",
  73             "-XX:+UnlockExperimentalVMOptions",
  74             "-Xmx30g",
  75             "-XX:-UseAOT", // AOT explicitly set klass shift to 3.
  76             "-Xlog:gc+metaspace=trace",
  77             "-Xshare:off",
  78             "-Xlog:cds=trace",
  79             "-XX:+VerifyBeforeGC", "-version");
  80         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  81         output.shouldNotContain("Narrow klass base: 0x0000000000000000");
  82         output.shouldContain("Narrow klass shift: 0");
  83         output.shouldHaveExitValue(0);
  84     }
  85 
  86     public static void largePagesTest() throws Exception {
  87         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  88             "-XX:+UnlockDiagnosticVMOptions",
  89             "-Xmx128m",
  90             "-XX:+UseLargePages",
  91             "-Xlog:gc+metaspace=trace",
  92             "-XX:+VerifyBeforeGC", "-version");
  93         OutputAnalyzer output = new OutputAnalyzer(pb.start());


< prev index next >