< prev index next >

test/hotspot/jtreg/gc/g1/TestHumongousAllocConcurrentStart.java

Print this page
rev 60060 : imported patch 8210462-lkorinth-review


   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  */
  23 
  24 package gc.g1;
  25 
  26 /*
  27  * @test TestHumongousAllocInitialMark
  28  * @bug 7168848
  29  * @summary G1: humongous object allocations should initiate marking cycles when necessary
  30  * @requires vm.gc.G1
  31  * @library /test/lib
  32  * @modules java.base/jdk.internal.misc
  33  *          java.management
  34  * @run driver gc.g1.TestHumongousAllocInitialMark
  35  */
  36 
  37 import jdk.test.lib.process.OutputAnalyzer;
  38 import jdk.test.lib.process.ProcessTools;
  39 
  40 public class TestHumongousAllocInitialMark {
  41     // Heap sizes < 224 MB are increased to 224 MB if vm_page_size == 64K to
  42     // fulfill alignment constraints.
  43     private static final int heapSize                       = 224; // MB
  44     private static final int heapRegionSize                 = 1;   // MB
  45     private static final int initiatingHeapOccupancyPercent = 50;  // %
  46 
  47     public static void main(String[] args) throws Exception {
  48         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  49             "-XX:+UseG1GC",
  50             "-Xms" + heapSize + "m",
  51             "-Xmx" + heapSize + "m",
  52             "-XX:G1HeapRegionSize=" + heapRegionSize + "m",
  53             "-XX:InitiatingHeapOccupancyPercent=" + initiatingHeapOccupancyPercent,
  54             "-Xlog:gc",
  55             HumongousObjectAllocator.class.getName());
  56 
  57         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  58         output.shouldContain("Pause Young (Concurrent Start) (G1 Humongous Allocation)");
  59         output.shouldNotContain("Full GC");
  60         output.shouldHaveExitValue(0);




   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  */
  23 
  24 package gc.g1;
  25 
  26 /*
  27  * @test TestHumongousAllocConcurrentStart
  28  * @bug 7168848
  29  * @summary G1: humongous object allocations should initiate marking cycles when necessary
  30  * @requires vm.gc.G1
  31  * @library /test/lib
  32  * @modules java.base/jdk.internal.misc
  33  *          java.management
  34  * @run driver gc.g1.TestHumongousAllocConcurrentStart
  35  */
  36 
  37 import jdk.test.lib.process.OutputAnalyzer;
  38 import jdk.test.lib.process.ProcessTools;
  39 
  40 public class TestHumongousAllocConcurrentStart {
  41     // Heap sizes < 224 MB are increased to 224 MB if vm_page_size == 64K to
  42     // fulfill alignment constraints.
  43     private static final int heapSize                       = 224; // MB
  44     private static final int heapRegionSize                 = 1;   // MB
  45     private static final int initiatingHeapOccupancyPercent = 50;  // %
  46 
  47     public static void main(String[] args) throws Exception {
  48         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  49             "-XX:+UseG1GC",
  50             "-Xms" + heapSize + "m",
  51             "-Xmx" + heapSize + "m",
  52             "-XX:G1HeapRegionSize=" + heapRegionSize + "m",
  53             "-XX:InitiatingHeapOccupancyPercent=" + initiatingHeapOccupancyPercent,
  54             "-Xlog:gc",
  55             HumongousObjectAllocator.class.getName());
  56 
  57         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  58         output.shouldContain("Pause Young (Concurrent Start) (G1 Humongous Allocation)");
  59         output.shouldNotContain("Full GC");
  60         output.shouldHaveExitValue(0);


< prev index next >