< prev index next >

test/gc/g1/TestLargePageUseForAuxMemory.java

Print this page




  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 /*
  25  * @test TestLargePageUseForAuxMemory.java
  26  * @bug 8058354
  27  * @key gc
  28  * @library /testlibrary /../../test/lib
  29  * @requires (vm.gc=="G1" | vm.gc=="null")
  30  * @build TestLargePageUseForAuxMemory
  31  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  32  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  33  * @summary Test that auxiliary data structures are allocated using large pages if available.
  34  * @run main/othervm -Xbootclasspath/a:. -XX:+UseG1GC -XX:+WhiteBoxAPI -XX:+IgnoreUnrecognizedVMOptions -XX:+UseLargePages TestLargePageUseForAuxMemory
  35  */
  36 
  37 import com.oracle.java.testlibrary.*;
  38 import sun.hotspot.WhiteBox;
  39 
  40 public class TestLargePageUseForAuxMemory {
  41     static final int HEAP_REGION_SIZE = 4 * 1024 * 1024;
  42     static long largePageSize;
  43     static long smallPageSize;
  44 
  45     static void checkSmallTables(OutputAnalyzer output, long expectedPageSize) throws Exception {
  46         output.shouldContain("G1 'Block offset table': pg_sz=" + expectedPageSize);
  47         output.shouldContain("G1 'Card counts table': pg_sz=" + expectedPageSize);
  48     }
  49 
  50     static void checkBitmaps(OutputAnalyzer output, long expectedPageSize) throws Exception {
  51         output.shouldContain("G1 'Prev Bitmap': pg_sz=" + expectedPageSize);
  52         output.shouldContain("G1 'Next Bitmap': pg_sz=" + expectedPageSize);
  53     }
  54 
  55     static void testVM(long heapsize, boolean cardsShouldUseLargePages, boolean bitmapShouldUseLargePages) throws Exception {
  56         ProcessBuilder pb;
  57         // Test with large page enabled.




  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 /*
  25  * @test TestLargePageUseForAuxMemory.java
  26  * @bug 8058354
  27  * @key gc
  28  * @library /testlibrary /../../test/lib
  29  * @requires (vm.gc=="G1" | vm.gc=="null")
  30  * @build TestLargePageUseForAuxMemory
  31  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  32  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  33  * @summary Test that auxiliary data structures are allocated using large pages if available.
  34  * @run main/othervm -Xbootclasspath/a:. -XX:+UseG1GC -XX:+WhiteBoxAPI -XX:+IgnoreUnrecognizedVMOptions -XX:+UseLargePages TestLargePageUseForAuxMemory
  35  */
  36 
  37 import jdk.test.lib.*;
  38 import sun.hotspot.WhiteBox;
  39 
  40 public class TestLargePageUseForAuxMemory {
  41     static final int HEAP_REGION_SIZE = 4 * 1024 * 1024;
  42     static long largePageSize;
  43     static long smallPageSize;
  44 
  45     static void checkSmallTables(OutputAnalyzer output, long expectedPageSize) throws Exception {
  46         output.shouldContain("G1 'Block offset table': pg_sz=" + expectedPageSize);
  47         output.shouldContain("G1 'Card counts table': pg_sz=" + expectedPageSize);
  48     }
  49 
  50     static void checkBitmaps(OutputAnalyzer output, long expectedPageSize) throws Exception {
  51         output.shouldContain("G1 'Prev Bitmap': pg_sz=" + expectedPageSize);
  52         output.shouldContain("G1 'Next Bitmap': pg_sz=" + expectedPageSize);
  53     }
  54 
  55     static void testVM(long heapsize, boolean cardsShouldUseLargePages, boolean bitmapShouldUseLargePages) throws Exception {
  56         ProcessBuilder pb;
  57         // Test with large page enabled.


< prev index next >