test/runtime/NMT/ThreadedVirtualAllocTestType.java

changeset 5586
5fd8e2fbafd4
parent 4885
3b890cd4da64
child 6876
710a3c8b516e
child 7075
ac12996df59b
     1.1 --- a/test/runtime/NMT/ThreadedVirtualAllocTestType.java	Fri Aug 23 20:33:02 2013 -0400
     1.2 +++ b/test/runtime/NMT/ThreadedVirtualAllocTestType.java	Fri Aug 23 12:36:32 2013 -0700
     1.3 @@ -45,6 +45,13 @@
     1.4      String pid = Integer.toString(ProcessTools.getProcessId());
     1.5      ProcessBuilder pb = new ProcessBuilder();
     1.6  
     1.7 +    boolean has_nmt_detail = wb.NMTIsDetailSupported();
     1.8 +    if (has_nmt_detail) {
     1.9 +      System.out.println("NMT detail support detected.");
    1.10 +    } else {
    1.11 +      System.out.println("NMT detail support not detected.");
    1.12 +    }
    1.13 +
    1.14      Thread reserveThread = new Thread() {
    1.15        public void run() {
    1.16          addr = wb.NMTReserveMemory(reserveSize);
    1.17 @@ -58,7 +65,9 @@
    1.18      pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "detail"});
    1.19      output = new OutputAnalyzer(pb.start());
    1.20      output.shouldContain("Test (reserved=512KB, committed=0KB)");
    1.21 -    output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + reserveSize) + "\\] reserved 512KB for Test");
    1.22 +    if (has_nmt_detail) {
    1.23 +      output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + reserveSize) + "\\] reserved 512KB for Test");
    1.24 +    }
    1.25  
    1.26      Thread commitThread = new Thread() {
    1.27        public void run() {
    1.28 @@ -72,7 +81,9 @@
    1.29  
    1.30      output = new OutputAnalyzer(pb.start());
    1.31      output.shouldContain("Test (reserved=512KB, committed=128KB)");
    1.32 -    output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + commitSize) + "\\] committed 128KB");
    1.33 +    if (has_nmt_detail) {
    1.34 +      output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + commitSize) + "\\] committed 128KB");
    1.35 +    }
    1.36  
    1.37      Thread uncommitThread = new Thread() {
    1.38        public void run() {

mercurial