提交 e724cb7d 编写于 作者: C ctornqvi

8055844: [TESTBUG] test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java...

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
上级 f9acb706
...@@ -42,8 +42,8 @@ public class VirtualAllocCommitUncommitRecommit { ...@@ -42,8 +42,8 @@ public class VirtualAllocCommitUncommitRecommit {
public static void main(String args[]) throws Exception { public static void main(String args[]) throws Exception {
OutputAnalyzer output; OutputAnalyzer output;
long commitSize = 4 * 1024; // 4KB long commitSize = 128 * 1024; // 128KB
long reserveSize = 1024 * 1024; // 1024KB long reserveSize = 4 * 1024 * 1024; // 4096KB
long addr; long addr;
String pid = Integer.toString(ProcessTools.getProcessId()); String pid = Integer.toString(ProcessTools.getProcessId());
...@@ -62,11 +62,11 @@ public class VirtualAllocCommitUncommitRecommit { ...@@ -62,11 +62,11 @@ public class VirtualAllocCommitUncommitRecommit {
"VM.native_memory", "detail" }); "VM.native_memory", "detail" });
output = new OutputAnalyzer(pb.start()); output = new OutputAnalyzer(pb.start());
output.shouldContain("Test (reserved=1024KB, committed=0KB)"); output.shouldContain("Test (reserved=4096KB, committed=0KB)");
if (has_nmt_detail) { if (has_nmt_detail) {
output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
+ Long.toHexString(addr + reserveSize) + Long.toHexString(addr + reserveSize)
+ "\\] reserved 1024KB for Test"); + "\\] reserved 4096KB for Test");
} }
long addrA = addr; long addrA = addr;
...@@ -83,24 +83,24 @@ public class VirtualAllocCommitUncommitRecommit { ...@@ -83,24 +83,24 @@ public class VirtualAllocCommitUncommitRecommit {
wb.NMTCommitMemory(addrD, commitSize); wb.NMTCommitMemory(addrD, commitSize);
output = new OutputAnalyzer(pb.start()); output = new OutputAnalyzer(pb.start());
output.shouldContain("Test (reserved=1024KB, committed=16KB)"); output.shouldContain("Test (reserved=4096KB, committed=512KB)");
if (has_nmt_detail) { if (has_nmt_detail) {
output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
+ Long.toHexString(addr + reserveSize) + Long.toHexString(addr + reserveSize)
+ "\\] reserved 1024KB for Test"); + "\\] reserved 4096KB for Test");
} }
// uncommit BC // uncommit BC
wb.NMTUncommitMemory(addrB, commitSize); wb.NMTUncommitMemory(addrB, commitSize);
wb.NMTUncommitMemory(addrC, commitSize); wb.NMTUncommitMemory(addrC, commitSize);
output = new OutputAnalyzer(pb.start()); output = new OutputAnalyzer(pb.start());
output.shouldContain("Test (reserved=1024KB, committed=8KB)"); output.shouldContain("Test (reserved=4096KB, committed=256KB)");
if (has_nmt_detail) { if (has_nmt_detail) {
output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
+ Long.toHexString(addr + reserveSize) + Long.toHexString(addr + reserveSize)
+ "\\] reserved 1024KB for Test"); + "\\] reserved 4096KB for Test");
} }
// commit EF // commit EF
...@@ -108,22 +108,22 @@ public class VirtualAllocCommitUncommitRecommit { ...@@ -108,22 +108,22 @@ public class VirtualAllocCommitUncommitRecommit {
wb.NMTCommitMemory(addrF, commitSize); wb.NMTCommitMemory(addrF, commitSize);
output = new OutputAnalyzer(pb.start()); output = new OutputAnalyzer(pb.start());
output.shouldContain("Test (reserved=1024KB, committed=16KB)"); output.shouldContain("Test (reserved=4096KB, committed=512KB)");
if (has_nmt_detail) { if (has_nmt_detail) {
output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
+ Long.toHexString(addr + reserveSize) + Long.toHexString(addr + reserveSize)
+ "\\] reserved 1024KB for Test"); + "\\] reserved 4096KB for Test");
} }
// uncommit A // uncommit A
wb.NMTUncommitMemory(addrA, commitSize); wb.NMTUncommitMemory(addrA, commitSize);
output = new OutputAnalyzer(pb.start()); output = new OutputAnalyzer(pb.start());
output.shouldContain("Test (reserved=1024KB, committed=12KB)"); output.shouldContain("Test (reserved=4096KB, committed=384KB)");
if (has_nmt_detail) { if (has_nmt_detail) {
output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
+ Long.toHexString(addr + reserveSize) + Long.toHexString(addr + reserveSize)
+ "\\] reserved 1024KB for Test"); + "\\] reserved 4096KB for Test");
} }
// commit ABC // commit ABC
...@@ -132,11 +132,11 @@ public class VirtualAllocCommitUncommitRecommit { ...@@ -132,11 +132,11 @@ public class VirtualAllocCommitUncommitRecommit {
wb.NMTCommitMemory(addrC, commitSize); wb.NMTCommitMemory(addrC, commitSize);
output = new OutputAnalyzer(pb.start()); output = new OutputAnalyzer(pb.start());
output.shouldContain("Test (reserved=1024KB, committed=24KB)"); output.shouldContain("Test (reserved=4096KB, committed=768KB)");
if (has_nmt_detail) { if (has_nmt_detail) {
output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
+ Long.toHexString(addr + reserveSize) + Long.toHexString(addr + reserveSize)
+ "\\] reserved 1024KB for Test"); + "\\] reserved 4096KB for Test");
} }
// uncommit ABCDEF // uncommit ABCDEF
...@@ -148,11 +148,11 @@ public class VirtualAllocCommitUncommitRecommit { ...@@ -148,11 +148,11 @@ public class VirtualAllocCommitUncommitRecommit {
wb.NMTUncommitMemory(addrF, commitSize); wb.NMTUncommitMemory(addrF, commitSize);
output = new OutputAnalyzer(pb.start()); output = new OutputAnalyzer(pb.start());
output.shouldContain("Test (reserved=1024KB, committed=0KB)"); output.shouldContain("Test (reserved=4096KB, committed=0KB)");
if (has_nmt_detail) { if (has_nmt_detail) {
output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
+ Long.toHexString(addr + reserveSize) + Long.toHexString(addr + reserveSize)
+ "\\] reserved 1024KB for Test"); + "\\] reserved 4096KB for Test");
} }
// release // release
...@@ -160,6 +160,6 @@ public class VirtualAllocCommitUncommitRecommit { ...@@ -160,6 +160,6 @@ public class VirtualAllocCommitUncommitRecommit {
output = new OutputAnalyzer(pb.start()); output = new OutputAnalyzer(pb.start());
output.shouldNotContain("Test (reserved="); output.shouldNotContain("Test (reserved=");
output.shouldNotMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" 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");
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册