8044140: Create NMT (Native Memory Tracking) tests for NMT2

Wed, 27 Aug 2014 08:35:03 -0400

author
zgu
date
Wed, 27 Aug 2014 08:35:03 -0400
changeset 7075
ac12996df59b
parent 7074
833b0f92429a
child 7076
f433f37645e5

8044140: Create NMT (Native Memory Tracking) tests for NMT2
Summary: Create new/modify existing tests for NMT2, which is an internal redesign to address scalability issues in the first implementation.
Reviewed-by: ctornqvi, zgu
Contributed-by: George Triantafillou <george.triantafillou@oracle.com>

test/TEST.ROOT file | annotate | diff | comparison | revisions
test/TEST.groups file | annotate | diff | comparison | revisions
test/runtime/NMT/BaselineWithParameter.java file | annotate | diff | comparison | revisions
test/runtime/NMT/CommandLineDetail.java file | annotate | diff | comparison | revisions
test/runtime/NMT/CommandLineEmptyArgument.java file | annotate | diff | comparison | revisions
test/runtime/NMT/CommandLineInvalidArgument.java file | annotate | diff | comparison | revisions
test/runtime/NMT/CommandLineSummary.java file | annotate | diff | comparison | revisions
test/runtime/NMT/CommandLineTurnOffNMT.java file | annotate | diff | comparison | revisions
test/runtime/NMT/JcmdScale.java file | annotate | diff | comparison | revisions
test/runtime/NMT/JcmdWithNMTDisabled.java file | annotate | diff | comparison | revisions
test/runtime/NMT/MallocTestType.java file | annotate | diff | comparison | revisions
test/runtime/NMT/PrintNMTStatistics.java file | annotate | diff | comparison | revisions
test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java file | annotate | diff | comparison | revisions
test/runtime/NMT/ReleaseCommittedMemory.java file | annotate | diff | comparison | revisions
test/runtime/NMT/ShutdownTwice.java file | annotate | diff | comparison | revisions
test/runtime/NMT/SummaryAfterShutdown.java file | annotate | diff | comparison | revisions
test/runtime/NMT/SummarySanityCheck.java file | annotate | diff | comparison | revisions
test/runtime/NMT/ThreadedMallocTestType.java file | annotate | diff | comparison | revisions
test/runtime/NMT/ThreadedVirtualAllocTestType.java file | annotate | diff | comparison | revisions
test/runtime/NMT/VirtualAllocTestType.java file | annotate | diff | comparison | revisions
test/testlibrary/whitebox/sun/hotspot/WhiteBox.java file | annotate | diff | comparison | revisions
     1.1 --- a/test/TEST.ROOT	Wed Aug 27 08:19:12 2014 -0400
     1.2 +++ b/test/TEST.ROOT	Wed Aug 27 08:35:03 2014 -0400
     1.3 @@ -1,5 +1,5 @@
     1.4  # 
     1.5 -# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 +# Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
     1.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8  #
     1.9  # This code is free software; you can redistribute it and/or modify it
    1.10 @@ -27,6 +27,6 @@
    1.11  # It also contains test-suite configuration information.
    1.12  
    1.13  # The list of keywords supported in this test suite
    1.14 -keys=cte_test jcmd nmt regression gc
    1.15 +keys=cte_test jcmd nmt regression gc stress
    1.16  
    1.17  groups=TEST.groups [closed/TEST.groups]
     2.1 --- a/test/TEST.groups	Wed Aug 27 08:19:12 2014 -0400
     2.2 +++ b/test/TEST.groups	Wed Aug 27 08:35:03 2014 -0400
     2.3 @@ -73,15 +73,23 @@
     2.4    runtime/jsig/Test8017498.sh \
     2.5    runtime/Metaspace/FragmentMetaspace.java \
     2.6    runtime/NMT/BaselineWithParameter.java \
     2.7 +  runtime/NMT/JcmdBaselineDetail.java \
     2.8 +  runtime/NMT/JcmdDetailDiff.java \
     2.9 +  runtime/NMT/JcmdScaleDetail.java \
    2.10    runtime/NMT/JcmdScale.java \
    2.11    runtime/NMT/JcmdWithNMTDisabled.java \
    2.12 +  runtime/NMT/MallocRoundingReportTest.java \
    2.13 +  runtime/NMT/MallocSiteHashOverflow.java \
    2.14 +  runtime/NMT/MallocStressTest.java \
    2.15    runtime/NMT/MallocTestType.java \
    2.16    runtime/NMT/ReleaseCommittedMemory.java \
    2.17 +  runtime/NMT/ReleaseNoCommit.java \
    2.18    runtime/NMT/ShutdownTwice.java \
    2.19    runtime/NMT/SummaryAfterShutdown.java \
    2.20    runtime/NMT/SummarySanityCheck.java \
    2.21    runtime/NMT/ThreadedMallocTestType.java \
    2.22    runtime/NMT/ThreadedVirtualAllocTestType.java \
    2.23 +  runtime/NMT/VirtualAllocCommitUncommitRecommit.java \
    2.24    runtime/NMT/VirtualAllocTestType.java \
    2.25    runtime/RedefineObject/TestRedefineObject.java \
    2.26    runtime/Thread/TestThreadDumpMonitorContention.java \
     3.1 --- a/test/runtime/NMT/BaselineWithParameter.java	Wed Aug 27 08:19:12 2014 -0400
     3.2 +++ b/test/runtime/NMT/BaselineWithParameter.java	Wed Aug 27 08:35:03 2014 -0400
     3.3 @@ -27,6 +27,7 @@
     3.4   * @key nmt jcmd regression
     3.5   * @summary Regression test for invoking a jcmd with baseline=false, result was that the target VM crashed
     3.6   * @library /testlibrary
     3.7 + * @ignore
     3.8   * @run main/othervm -XX:NativeMemoryTracking=detail BaselineWithParameter
     3.9   */
    3.10  
     4.1 --- a/test/runtime/NMT/CommandLineDetail.java	Wed Aug 27 08:19:12 2014 -0400
     4.2 +++ b/test/runtime/NMT/CommandLineDetail.java	Wed Aug 27 08:35:03 2014 -0400
     4.3 @@ -26,6 +26,7 @@
     4.4   * @key nmt
     4.5   * @summary Running with NMT detail should not result in an error
     4.6   * @library /testlibrary
     4.7 + * @ignore
     4.8   */
     4.9  
    4.10  import com.oracle.java.testlibrary.*;
     5.1 --- a/test/runtime/NMT/CommandLineEmptyArgument.java	Wed Aug 27 08:19:12 2014 -0400
     5.2 +++ b/test/runtime/NMT/CommandLineEmptyArgument.java	Wed Aug 27 08:35:03 2014 -0400
     5.3 @@ -26,6 +26,7 @@
     5.4   * @key nmt
     5.5   * @summary Empty argument to NMT should result in an informative error message
     5.6   * @library /testlibrary
     5.7 + * @ignore
     5.8   */
     5.9  
    5.10  import com.oracle.java.testlibrary.*;
     6.1 --- a/test/runtime/NMT/CommandLineInvalidArgument.java	Wed Aug 27 08:19:12 2014 -0400
     6.2 +++ b/test/runtime/NMT/CommandLineInvalidArgument.java	Wed Aug 27 08:35:03 2014 -0400
     6.3 @@ -26,6 +26,7 @@
     6.4   * @key nmt
     6.5   * @summary Invalid argument to NMT should result in an informative error message
     6.6   * @library /testlibrary
     6.7 + * @ignore
     6.8   */
     6.9  
    6.10  import com.oracle.java.testlibrary.*;
     7.1 --- a/test/runtime/NMT/CommandLineSummary.java	Wed Aug 27 08:19:12 2014 -0400
     7.2 +++ b/test/runtime/NMT/CommandLineSummary.java	Wed Aug 27 08:35:03 2014 -0400
     7.3 @@ -26,6 +26,7 @@
     7.4   * @key nmt
     7.5   * @summary Running with NMT summary should not result in an error
     7.6   * @library /testlibrary
     7.7 + * @ignore
     7.8   */
     7.9  
    7.10  import com.oracle.java.testlibrary.*;
     8.1 --- a/test/runtime/NMT/CommandLineTurnOffNMT.java	Wed Aug 27 08:19:12 2014 -0400
     8.2 +++ b/test/runtime/NMT/CommandLineTurnOffNMT.java	Wed Aug 27 08:35:03 2014 -0400
     8.3 @@ -26,6 +26,7 @@
     8.4   * @key nmt
     8.5   * @summary Turning off NMT should not result in an error
     8.6   * @library /testlibrary
     8.7 + * @ignore
     8.8   */
     8.9  
    8.10  import com.oracle.java.testlibrary.*;
     9.1 --- a/test/runtime/NMT/JcmdScale.java	Wed Aug 27 08:19:12 2014 -0400
     9.2 +++ b/test/runtime/NMT/JcmdScale.java	Wed Aug 27 08:35:03 2014 -0400
     9.3 @@ -26,6 +26,7 @@
     9.4   * @key nmt jcmd
     9.5   * @summary Test the NMT scale parameter
     9.6   * @library /testlibrary
     9.7 + * @ignore
     9.8   * @run main/othervm -XX:NativeMemoryTracking=summary JcmdScale
     9.9   */
    9.10  
    9.11 @@ -41,15 +42,15 @@
    9.12  
    9.13      pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "scale=KB"});
    9.14      output = new OutputAnalyzer(pb.start());
    9.15 -    output.shouldContain("KB,  committed=");
    9.16 +    output.shouldContain("KB, committed=");
    9.17  
    9.18      pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "scale=MB"});
    9.19      output = new OutputAnalyzer(pb.start());
    9.20 -    output.shouldContain("MB,  committed=");
    9.21 +    output.shouldContain("MB, committed=");
    9.22  
    9.23      pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "scale=GB"});
    9.24      output = new OutputAnalyzer(pb.start());
    9.25 -    output.shouldContain("GB,  committed=");
    9.26 +    output.shouldContain("GB, committed=");
    9.27  
    9.28      pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "scale=apa"});
    9.29      output = new OutputAnalyzer(pb.start());
    9.30 @@ -57,7 +58,7 @@
    9.31  
    9.32      pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary", "scale=GB"});
    9.33      output = new OutputAnalyzer(pb.start());
    9.34 -    output.shouldContain("GB,  committed=");
    9.35 +    output.shouldContain("GB, committed=");
    9.36  
    9.37      pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary", "scale=apa"});
    9.38      output = new OutputAnalyzer(pb.start());
    10.1 --- a/test/runtime/NMT/JcmdWithNMTDisabled.java	Wed Aug 27 08:19:12 2014 -0400
    10.2 +++ b/test/runtime/NMT/JcmdWithNMTDisabled.java	Wed Aug 27 08:35:03 2014 -0400
    10.3 @@ -26,6 +26,7 @@
    10.4   * @key nmt jcmd
    10.5   * @summary Verify that jcmd correctly reports that NMT is not enabled
    10.6   * @library /testlibrary
    10.7 + * @ignore
    10.8   * First run without enabling NMT
    10.9   * @run main/othervm JcmdWithNMTDisabled
   10.10   * Then run with explicitly disabling NMT, should not be any difference
    11.1 --- a/test/runtime/NMT/MallocTestType.java	Wed Aug 27 08:19:12 2014 -0400
    11.2 +++ b/test/runtime/NMT/MallocTestType.java	Wed Aug 27 08:35:03 2014 -0400
    11.3 @@ -1,5 +1,5 @@
    11.4  /*
    11.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    11.6 + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
    11.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    11.8   *
    11.9   * This code is free software; you can redistribute it and/or modify it
   11.10 @@ -27,6 +27,7 @@
   11.11   * @key nmt jcmd
   11.12   * @library /testlibrary /testlibrary/whitebox
   11.13   * @build MallocTestType
   11.14 + * @ignore
   11.15   * @run main ClassFileInstaller sun.hotspot.WhiteBox
   11.16   * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocTestType
   11.17   */
   11.18 @@ -51,11 +52,6 @@
   11.19      long memAlloc1 = wb.NMTMalloc(512 * 1024);
   11.20      wb.NMTFree(memAlloc2);
   11.21  
   11.22 -    // Use WB API to ensure that all data has been merged before we continue
   11.23 -    if (!wb.NMTWaitForDataMerge()) {
   11.24 -      throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
   11.25 -    }
   11.26 -
   11.27      // Run 'jcmd <pid> VM.native_memory summary'
   11.28      pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary"});
   11.29      output = new OutputAnalyzer(pb.start());
   11.30 @@ -64,10 +60,6 @@
   11.31      // Free the memory allocated by NMTAllocTest
   11.32      wb.NMTFree(memAlloc1);
   11.33  
   11.34 -    // Use WB API to ensure that all data has been merged before we continue
   11.35 -    if (!wb.NMTWaitForDataMerge()) {
   11.36 -      throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
   11.37 -    }
   11.38      output = new OutputAnalyzer(pb.start());
   11.39      output.shouldNotContain("Test (reserved=");
   11.40    }
    12.1 --- a/test/runtime/NMT/PrintNMTStatistics.java	Wed Aug 27 08:19:12 2014 -0400
    12.2 +++ b/test/runtime/NMT/PrintNMTStatistics.java	Wed Aug 27 08:35:03 2014 -0400
    12.3 @@ -28,6 +28,7 @@
    12.4   * @summary Make sure PrintNMTStatistics works on normal JVM exit
    12.5   * @library /testlibrary /testlibrary/whitebox
    12.6   * @build PrintNMTStatistics
    12.7 + * @ignore
    12.8   * @run main ClassFileInstaller sun.hotspot.WhiteBox
    12.9   * @run main PrintNMTStatistics
   12.10   */
   12.11 @@ -45,10 +46,6 @@
   12.12      // We start a new java process running with an argument and use WB API to ensure
   12.13      // we have data for NMT on VM exit
   12.14      if (args.length > 0) {
   12.15 -      // Use WB API to ensure that all data has been merged before we continue
   12.16 -      if (!WhiteBox.getWhiteBox().NMTWaitForDataMerge()) {
   12.17 -        throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
   12.18 -      }
   12.19        return;
   12.20      }
   12.21  
    13.1 --- a/test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java	Wed Aug 27 08:19:12 2014 -0400
    13.2 +++ b/test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java	Wed Aug 27 08:35:03 2014 -0400
    13.3 @@ -26,6 +26,7 @@
    13.4   * @key nmt
    13.5   * @summary Trying to enable PrintNMTStatistics should result in a warning
    13.6   * @library /testlibrary
    13.7 + * @ignore
    13.8   */
    13.9  
   13.10  import com.oracle.java.testlibrary.*;
    14.1 --- a/test/runtime/NMT/ReleaseCommittedMemory.java	Wed Aug 27 08:19:12 2014 -0400
    14.2 +++ b/test/runtime/NMT/ReleaseCommittedMemory.java	Wed Aug 27 08:35:03 2014 -0400
    14.3 @@ -1,5 +1,5 @@
    14.4  /*
    14.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    14.6 + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
    14.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    14.8   *
    14.9   * This code is free software; you can redistribute it and/or modify it
   14.10 @@ -28,6 +28,7 @@
   14.11   * @key nmt regression
   14.12   * @library /testlibrary /testlibrary/whitebox
   14.13   * @build ReleaseCommittedMemory
   14.14 + * @ignore
   14.15   * @run main ClassFileInstaller sun.hotspot.WhiteBox
   14.16   * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ReleaseCommittedMemory
   14.17   */
   14.18 @@ -44,7 +45,6 @@
   14.19      addr = wb.NMTReserveMemory(reserveSize);
   14.20      wb.NMTCommitMemory(addr, 128*1024);
   14.21      wb.NMTReleaseMemory(addr, reserveSize);
   14.22 -    wb.NMTWaitForDataMerge();
   14.23    }
   14.24  }
   14.25  
    15.1 --- a/test/runtime/NMT/ShutdownTwice.java	Wed Aug 27 08:19:12 2014 -0400
    15.2 +++ b/test/runtime/NMT/ShutdownTwice.java	Wed Aug 27 08:35:03 2014 -0400
    15.3 @@ -1,5 +1,5 @@
    15.4  /*
    15.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    15.6 + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
    15.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    15.8   *
    15.9   * This code is free software; you can redistribute it and/or modify it
   15.10 @@ -26,6 +26,7 @@
   15.11   * @key nmt jcmd
   15.12   * @summary Run shutdown twice
   15.13   * @library /testlibrary
   15.14 + * @ignore
   15.15   * @run main/othervm -XX:NativeMemoryTracking=detail ShutdownTwice
   15.16   */
   15.17  
   15.18 @@ -45,12 +46,12 @@
   15.19      output = new OutputAnalyzer(pb.start());
   15.20  
   15.21      // Verify that jcmd reports that NMT is shutting down
   15.22 -    output.shouldContain("Shutdown is in progress, it will take a few moments to completely shutdown");
   15.23 +    output.shouldContain("Native memory tracking has been turned off");
   15.24  
   15.25      // Run shutdown again
   15.26      output = new OutputAnalyzer(pb.start());
   15.27  
   15.28      // Verify that jcmd reports that NMT has been shutdown already
   15.29 -    output.shouldContain("Native memory tracking has been shutdown by user");
   15.30 +    output.shouldContain("Native memory tracking has been shutdown");
   15.31    }
   15.32  }
    16.1 --- a/test/runtime/NMT/SummaryAfterShutdown.java	Wed Aug 27 08:19:12 2014 -0400
    16.2 +++ b/test/runtime/NMT/SummaryAfterShutdown.java	Wed Aug 27 08:35:03 2014 -0400
    16.3 @@ -1,5 +1,5 @@
    16.4  /*
    16.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    16.6 + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
    16.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    16.8   *
    16.9   * This code is free software; you can redistribute it and/or modify it
   16.10 @@ -26,6 +26,7 @@
   16.11   * @key nmt jcmd
   16.12   * @summary Verify that jcmd correctly reports that NMT is not enabled after a shutdown
   16.13   * @library /testlibrary
   16.14 + * @ignore
   16.15   * @run main/othervm -XX:NativeMemoryTracking=detail SummaryAfterShutdown
   16.16   */
   16.17  
   16.18 @@ -44,13 +45,13 @@
   16.19      output = new OutputAnalyzer(pb.start());
   16.20  
   16.21      // Verify that jcmd reports that NMT is shutting down
   16.22 -    output.shouldContain("Shutdown is in progress, it will take a few moments to completely shutdown");
   16.23 +    output.shouldContain("Native memory tracking has been turned off");
   16.24  
   16.25      // Run 'jcmd <pid> VM.native_memory summary'
   16.26      pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary"});
   16.27      output = new OutputAnalyzer(pb.start());
   16.28  
   16.29      // Verify that jcmd reports that NMT has been shutdown
   16.30 -    output.shouldContain("Native memory tracking has been shutdown by user");
   16.31 +    output.shouldContain("Native memory tracking has been shutdown");
   16.32    }
   16.33  }
    17.1 --- a/test/runtime/NMT/SummarySanityCheck.java	Wed Aug 27 08:19:12 2014 -0400
    17.2 +++ b/test/runtime/NMT/SummarySanityCheck.java	Wed Aug 27 08:35:03 2014 -0400
    17.3 @@ -1,5 +1,5 @@
    17.4  /*
    17.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    17.6 + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
    17.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    17.8   *
    17.9   * This code is free software; you can redistribute it and/or modify it
   17.10 @@ -27,6 +27,7 @@
   17.11   * @summary Sanity check the output of NMT
   17.12   * @library /testlibrary /testlibrary/whitebox
   17.13   * @build SummarySanityCheck
   17.14 + * @ignore
   17.15   * @run main ClassFileInstaller sun.hotspot.WhiteBox
   17.16   * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+WhiteBoxAPI SummarySanityCheck
   17.17   */
   17.18 @@ -44,11 +45,6 @@
   17.19      // Grab my own PID
   17.20      String pid = Integer.toString(ProcessTools.getProcessId());
   17.21  
   17.22 -    // Use WB API to ensure that all data has been merged before we continue
   17.23 -    if (!WhiteBox.getWhiteBox().NMTWaitForDataMerge()) {
   17.24 -      throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
   17.25 -    }
   17.26 -
   17.27      ProcessBuilder pb = new ProcessBuilder();
   17.28  
   17.29      // Run  'jcmd <pid> VM.native_memory summary scale=KB'
   17.30 @@ -69,13 +65,13 @@
   17.31      // Match '- <mtType> (reserved=<reserved>KB, committed=<committed>KB)
   17.32      Pattern mtTypePattern = Pattern.compile("-\\s+(?<typename>[\\w\\s]+)\\(reserved=(?<reserved>\\d+)KB,\\scommitted=(?<committed>\\d+)KB\\)");
   17.33      // Match 'Total: reserved=<reserved>KB, committed=<committed>KB'
   17.34 -    Pattern totalMemoryPattern = Pattern.compile("Total\\:\\s\\sreserved=(?<reserved>\\d+)KB,\\s\\scommitted=(?<committed>\\d+)KB");
   17.35 +    Pattern totalMemoryPattern = Pattern.compile("Total\\:\\sreserved=(?<reserved>\\d+)KB,\\scommitted=(?<committed>\\d+)KB");
   17.36  
   17.37      for (int i = 0; i < lines.length; i++) {
   17.38        if (lines[i].startsWith("Total")) {
   17.39          Matcher totalMemoryMatcher = totalMemoryPattern.matcher(lines[i]);
   17.40  
   17.41 -        if (totalMemoryMatcher.matches() && totalMemoryMatcher.groupCount() == 2) {
   17.42 +        if (totalMemoryMatcher.matches()) {
   17.43            totalCommitted = Integer.parseInt(totalMemoryMatcher.group("committed"));
   17.44            totalReserved = Integer.parseInt(totalMemoryMatcher.group("reserved"));
   17.45          } else {
    18.1 --- a/test/runtime/NMT/ThreadedMallocTestType.java	Wed Aug 27 08:19:12 2014 -0400
    18.2 +++ b/test/runtime/NMT/ThreadedMallocTestType.java	Wed Aug 27 08:35:03 2014 -0400
    18.3 @@ -1,5 +1,5 @@
    18.4  /*
    18.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    18.6 + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
    18.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    18.8   *
    18.9   * This code is free software; you can redistribute it and/or modify it
   18.10 @@ -26,6 +26,7 @@
   18.11   * @key nmt jcmd
   18.12   * @library /testlibrary /testlibrary/whitebox
   18.13   * @build ThreadedMallocTestType
   18.14 + * @ignore
   18.15   * @run main ClassFileInstaller sun.hotspot.WhiteBox
   18.16   * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ThreadedMallocTestType
   18.17   */
   18.18 @@ -58,11 +59,6 @@
   18.19      allocThread.start();
   18.20      allocThread.join();
   18.21  
   18.22 -    // Use WB API to ensure that all data has been merged before we continue
   18.23 -    if (!wb.NMTWaitForDataMerge()) {
   18.24 -      throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
   18.25 -    }
   18.26 -
   18.27      // Run 'jcmd <pid> VM.native_memory summary'
   18.28      pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary"});
   18.29      output = new OutputAnalyzer(pb.start());
   18.30 @@ -80,11 +76,6 @@
   18.31      freeThread.start();
   18.32      freeThread.join();
   18.33  
   18.34 -    // Use WB API to ensure that all data has been merged before we continue
   18.35 -    if (!wb.NMTWaitForDataMerge()) {
   18.36 -      throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
   18.37 -    }
   18.38 -
   18.39      output = new OutputAnalyzer(pb.start());
   18.40      output.shouldNotContain("Test (reserved=");
   18.41    }
    19.1 --- a/test/runtime/NMT/ThreadedVirtualAllocTestType.java	Wed Aug 27 08:19:12 2014 -0400
    19.2 +++ b/test/runtime/NMT/ThreadedVirtualAllocTestType.java	Wed Aug 27 08:35:03 2014 -0400
    19.3 @@ -1,5 +1,5 @@
    19.4  /*
    19.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    19.6 + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
    19.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    19.8   *
    19.9   * This code is free software; you can redistribute it and/or modify it
   19.10 @@ -26,6 +26,7 @@
   19.11   * @key nmt jcmd
   19.12   * @library /testlibrary /testlibrary/whitebox
   19.13   * @build ThreadedVirtualAllocTestType
   19.14 + * @ignore
   19.15   * @run main ClassFileInstaller sun.hotspot.WhiteBox
   19.16   * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ThreadedVirtualAllocTestType
   19.17   */
   19.18 @@ -60,8 +61,6 @@
   19.19      reserveThread.start();
   19.20      reserveThread.join();
   19.21  
   19.22 -    mergeData();
   19.23 -
   19.24      pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "detail"});
   19.25      output = new OutputAnalyzer(pb.start());
   19.26      output.shouldContain("Test (reserved=512KB, committed=0KB)");
   19.27 @@ -77,8 +76,6 @@
   19.28      commitThread.start();
   19.29      commitThread.join();
   19.30  
   19.31 -    mergeData();
   19.32 -
   19.33      output = new OutputAnalyzer(pb.start());
   19.34      output.shouldContain("Test (reserved=512KB, committed=128KB)");
   19.35      if (has_nmt_detail) {
   19.36 @@ -93,8 +90,6 @@
   19.37      uncommitThread.start();
   19.38      uncommitThread.join();
   19.39  
   19.40 -    mergeData();
   19.41 -
   19.42      output = new OutputAnalyzer(pb.start());
   19.43      output.shouldContain("Test (reserved=512KB, committed=0KB)");
   19.44      output.shouldNotMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + commitSize) + "\\] committed");
   19.45 @@ -107,17 +102,9 @@
   19.46      releaseThread.start();
   19.47      releaseThread.join();
   19.48  
   19.49 -    mergeData();
   19.50 -
   19.51      output = new OutputAnalyzer(pb.start());
   19.52      output.shouldNotContain("Test (reserved=");
   19.53      output.shouldNotContain("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + reserveSize) + "\\] reserved");
   19.54    }
   19.55  
   19.56 -  public static void mergeData() throws Exception {
   19.57 -    // Use WB API to ensure that all data has been merged before we continue
   19.58 -    if (!wb.NMTWaitForDataMerge()) {
   19.59 -      throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
   19.60      }
   19.61 -  }
   19.62 -}
    20.1 --- a/test/runtime/NMT/VirtualAllocTestType.java	Wed Aug 27 08:19:12 2014 -0400
    20.2 +++ b/test/runtime/NMT/VirtualAllocTestType.java	Wed Aug 27 08:35:03 2014 -0400
    20.3 @@ -1,5 +1,5 @@
    20.4  /*
    20.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    20.6 + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
    20.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    20.8   *
    20.9   * This code is free software; you can redistribute it and/or modify it
   20.10 @@ -26,6 +26,7 @@
   20.11   * @summary Test Reserve/Commit/Uncommit/Release of virtual memory and that we track it correctly
   20.12   * @key nmt jcmd
   20.13   * @library /testlibrary /testlibrary/whitebox
   20.14 + * @ignore
   20.15   * @build VirtualAllocTestType
   20.16   * @run main ClassFileInstaller sun.hotspot.WhiteBox
   20.17   * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail VirtualAllocTestType
   20.18 @@ -54,7 +55,6 @@
   20.19      }
   20.20  
   20.21      addr = wb.NMTReserveMemory(reserveSize);
   20.22 -    mergeData();
   20.23      pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "detail"});
   20.24  
   20.25      output = new OutputAnalyzer(pb.start());
   20.26 @@ -65,7 +65,6 @@
   20.27  
   20.28      wb.NMTCommitMemory(addr, commitSize);
   20.29  
   20.30 -    mergeData();
   20.31  
   20.32      output = new OutputAnalyzer(pb.start());
   20.33      output.shouldContain("Test (reserved=256KB, committed=128KB)");
   20.34 @@ -75,24 +74,15 @@
   20.35  
   20.36      wb.NMTUncommitMemory(addr, commitSize);
   20.37  
   20.38 -    mergeData();
   20.39  
   20.40      output = new OutputAnalyzer(pb.start());
   20.41      output.shouldContain("Test (reserved=256KB, committed=0KB)");
   20.42      output.shouldNotMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + commitSize) + "\\] committed");
   20.43  
   20.44      wb.NMTReleaseMemory(addr, reserveSize);
   20.45 -    mergeData();
   20.46  
   20.47      output = new OutputAnalyzer(pb.start());
   20.48      output.shouldNotContain("Test (reserved=");
   20.49      output.shouldNotMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + reserveSize) + "\\] reserved");
   20.50    }
   20.51 -
   20.52 -  public static void mergeData() throws Exception {
   20.53 -    // Use WB API to ensure that all data has been merged before we continue
   20.54 -    if (!wb.NMTWaitForDataMerge()) {
   20.55 -      throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
   20.56      }
   20.57 -  }
   20.58 -}
    21.1 --- a/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java	Wed Aug 27 08:19:12 2014 -0400
    21.2 +++ b/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java	Wed Aug 27 08:35:03 2014 -0400
    21.3 @@ -132,7 +132,7 @@
    21.4    }
    21.5    public native int     getCompileQueueSize(int compLevel);
    21.6    public native boolean testSetForceInlineMethod(Executable method, boolean value);
    21.7 -  public        boolean enqueueMethodForCompilation(Executable method, int compLevel) {
    21.8 +  public boolean        enqueueMethodForCompilation(Executable method, int compLevel) {
    21.9      return enqueueMethodForCompilation(method, compLevel, -1 /*InvocationEntryBci*/);
   21.10    }
   21.11    public native boolean enqueueMethodForCompilation(Executable method, int compLevel, int entry_bci);
   21.12 @@ -145,8 +145,6 @@
   21.13  
   21.14    // Memory
   21.15    public native void readReservedMemory();
   21.16 -  public native long allocateMetaspace(ClassLoader classLoader, long size);
   21.17 -  public native void freeMetaspace(ClassLoader classLoader, long addr, long size);
   21.18  
   21.19    // force Young GC
   21.20    public native void youngGC();
   21.21 @@ -162,17 +160,4 @@
   21.22    // CPU features
   21.23    public native String getCPUFeatures();
   21.24  
   21.25 -  // VM flags
   21.26 -  public native void    setBooleanVMFlag(String name, boolean value);
   21.27 -  public native void    setIntxVMFlag(String name, long value);
   21.28 -  public native void    setUintxVMFlag(String name, long value);
   21.29 -  public native void    setUint64VMFlag(String name, long value);
   21.30 -  public native void    setStringVMFlag(String name, String value);
   21.31 -  public native void    setDoubleVMFlag(String name, double value);
   21.32 -  public native Boolean getBooleanVMFlag(String name);
   21.33 -  public native Long    getIntxVMFlag(String name);
   21.34 -  public native Long    getUintxVMFlag(String name);
   21.35 -  public native Long    getUint64VMFlag(String name);
   21.36 -  public native String  getStringVMFlag(String name);
   21.37 -  public native Double  getDoubleVMFlag(String name);
   21.38  }

mercurial