8055844: [TESTBUG] test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java fails on Solaris Sparc due to incorrect page size being used
authorctornqvi
Fri, 22 Aug 2014 14:21:41 -0700
changeset 26303 ef9b4c475c1d
parent 26302 e3228e31a08d
child 26304 a28e6335ce60
8055844: [TESTBUG] test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java fails on Solaris Sparc due to incorrect page size being used Summary: Use 128KB chunks for virtual memory operations Reviewed-by: zgu, gtriantafill
hotspot/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java
--- a/hotspot/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java	Fri Aug 22 06:28:14 2014 -0700
+++ b/hotspot/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java	Fri Aug 22 14:21:41 2014 -0700
@@ -42,8 +42,8 @@
 
     public static void main(String args[]) throws Exception {
         OutputAnalyzer output;
-        long commitSize = 4 * 1024; // 4KB
-        long reserveSize = 1024 * 1024; // 1024KB
+        long commitSize = 128 * 1024; // 128KB
+        long reserveSize = 4 * 1024 * 1024; // 4096KB
         long addr;
 
         String pid = Integer.toString(ProcessTools.getProcessId());
@@ -62,11 +62,11 @@
                 "VM.native_memory", "detail" });
 
         output = new OutputAnalyzer(pb.start());
-        output.shouldContain("Test (reserved=1024KB, committed=0KB)");
+        output.shouldContain("Test (reserved=4096KB, committed=0KB)");
         if (has_nmt_detail) {
             output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
                     + Long.toHexString(addr + reserveSize)
-                    + "\\] reserved 1024KB for Test");
+                    + "\\] reserved 4096KB for Test");
         }
 
         long addrA = addr;
@@ -83,24 +83,24 @@
         wb.NMTCommitMemory(addrD, commitSize);
 
         output = new OutputAnalyzer(pb.start());
-        output.shouldContain("Test (reserved=1024KB, committed=16KB)");
+        output.shouldContain("Test (reserved=4096KB, committed=512KB)");
 
         if (has_nmt_detail) {
             output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
                     + Long.toHexString(addr + reserveSize)
-                    + "\\] reserved 1024KB for Test");
+                    + "\\] reserved 4096KB for Test");
         }
         // uncommit BC
         wb.NMTUncommitMemory(addrB, commitSize);
         wb.NMTUncommitMemory(addrC, commitSize);
 
         output = new OutputAnalyzer(pb.start());
-        output.shouldContain("Test (reserved=1024KB, committed=8KB)");
+        output.shouldContain("Test (reserved=4096KB, committed=256KB)");
 
         if (has_nmt_detail) {
             output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
                     + Long.toHexString(addr + reserveSize)
-                    + "\\] reserved 1024KB for Test");
+                    + "\\] reserved 4096KB for Test");
         }
 
         // commit EF
@@ -108,22 +108,22 @@
         wb.NMTCommitMemory(addrF, commitSize);
 
         output = new OutputAnalyzer(pb.start());
-        output.shouldContain("Test (reserved=1024KB, committed=16KB)");
+        output.shouldContain("Test (reserved=4096KB, committed=512KB)");
         if (has_nmt_detail) {
             output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
                     + Long.toHexString(addr + reserveSize)
-                    + "\\] reserved 1024KB for Test");
+                    + "\\] reserved 4096KB for Test");
         }
 
         // uncommit A
         wb.NMTUncommitMemory(addrA, commitSize);
 
         output = new OutputAnalyzer(pb.start());
-        output.shouldContain("Test (reserved=1024KB, committed=12KB)");
+        output.shouldContain("Test (reserved=4096KB, committed=384KB)");
         if (has_nmt_detail) {
             output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
                     + Long.toHexString(addr + reserveSize)
-                    + "\\] reserved 1024KB for Test");
+                    + "\\] reserved 4096KB for Test");
         }
 
         // commit ABC
@@ -132,11 +132,11 @@
         wb.NMTCommitMemory(addrC, commitSize);
 
         output = new OutputAnalyzer(pb.start());
-        output.shouldContain("Test (reserved=1024KB, committed=24KB)");
+        output.shouldContain("Test (reserved=4096KB, committed=768KB)");
         if (has_nmt_detail) {
             output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
                     + Long.toHexString(addr + reserveSize)
-                    + "\\] reserved 1024KB for Test");
+                    + "\\] reserved 4096KB for Test");
         }
 
         // uncommit ABCDEF
@@ -148,11 +148,11 @@
         wb.NMTUncommitMemory(addrF, commitSize);
 
         output = new OutputAnalyzer(pb.start());
-        output.shouldContain("Test (reserved=1024KB, committed=0KB)");
+        output.shouldContain("Test (reserved=4096KB, committed=0KB)");
         if (has_nmt_detail) {
             output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
                     + Long.toHexString(addr + reserveSize)
-                    + "\\] reserved 1024KB for Test");
+                    + "\\] reserved 4096KB for Test");
         }
 
         // release
@@ -160,6 +160,6 @@
         output = new OutputAnalyzer(pb.start());
         output.shouldNotContain("Test (reserved=");
         output.shouldNotMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
-                + Long.toHexString(addr + reserveSize) + "\\] reserved 1024KB for Test");
+                + Long.toHexString(addr + reserveSize) + "\\] reserved 4096KB for Test");
     }
 }