test/runtime/NMT/SummarySanityCheck.java

changeset 7075
ac12996df59b
parent 4637
1b0dc9f87e75
child 7110
6640f982c1be
     1.1 --- a/test/runtime/NMT/SummarySanityCheck.java	Wed Aug 27 08:19:12 2014 -0400
     1.2 +++ b/test/runtime/NMT/SummarySanityCheck.java	Wed Aug 27 08:35:03 2014 -0400
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2013, 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,7 @@
    1.11   * @summary Sanity check the output of NMT
    1.12   * @library /testlibrary /testlibrary/whitebox
    1.13   * @build SummarySanityCheck
    1.14 + * @ignore
    1.15   * @run main ClassFileInstaller sun.hotspot.WhiteBox
    1.16   * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+WhiteBoxAPI SummarySanityCheck
    1.17   */
    1.18 @@ -44,11 +45,6 @@
    1.19      // Grab my own PID
    1.20      String pid = Integer.toString(ProcessTools.getProcessId());
    1.21  
    1.22 -    // Use WB API to ensure that all data has been merged before we continue
    1.23 -    if (!WhiteBox.getWhiteBox().NMTWaitForDataMerge()) {
    1.24 -      throw new Exception("Call to WB API NMTWaitForDataMerge() failed");
    1.25 -    }
    1.26 -
    1.27      ProcessBuilder pb = new ProcessBuilder();
    1.28  
    1.29      // Run  'jcmd <pid> VM.native_memory summary scale=KB'
    1.30 @@ -69,13 +65,13 @@
    1.31      // Match '- <mtType> (reserved=<reserved>KB, committed=<committed>KB)
    1.32      Pattern mtTypePattern = Pattern.compile("-\\s+(?<typename>[\\w\\s]+)\\(reserved=(?<reserved>\\d+)KB,\\scommitted=(?<committed>\\d+)KB\\)");
    1.33      // Match 'Total: reserved=<reserved>KB, committed=<committed>KB'
    1.34 -    Pattern totalMemoryPattern = Pattern.compile("Total\\:\\s\\sreserved=(?<reserved>\\d+)KB,\\s\\scommitted=(?<committed>\\d+)KB");
    1.35 +    Pattern totalMemoryPattern = Pattern.compile("Total\\:\\sreserved=(?<reserved>\\d+)KB,\\scommitted=(?<committed>\\d+)KB");
    1.36  
    1.37      for (int i = 0; i < lines.length; i++) {
    1.38        if (lines[i].startsWith("Total")) {
    1.39          Matcher totalMemoryMatcher = totalMemoryPattern.matcher(lines[i]);
    1.40  
    1.41 -        if (totalMemoryMatcher.matches() && totalMemoryMatcher.groupCount() == 2) {
    1.42 +        if (totalMemoryMatcher.matches()) {
    1.43            totalCommitted = Integer.parseInt(totalMemoryMatcher.group("committed"));
    1.44            totalReserved = Integer.parseInt(totalMemoryMatcher.group("reserved"));
    1.45          } else {

mercurial