Print this page


Split Close
Expand all
Collapse all
          --- old/test/java/util/concurrent/locks/Lock/TimedAcquireLeak.java
          +++ new/test/java/util/concurrent/locks/Lock/TimedAcquireLeak.java
↓ open down ↓ 140 lines elided ↑ open up ↑
 141  141          // jmap doesn't work on Windows
 142  142          if (System.getProperty("os.name").startsWith("Windows"))
 143  143              return;
 144  144  
 145  145          final String childClassName = Job.class.getName();
 146  146          final String classToCheckForLeaks = Job.classToCheckForLeaks();
 147  147          final String uniqueID =
 148  148              String.valueOf(new Random().nextInt(Integer.MAX_VALUE));
 149  149  
 150  150          final String[] jobCmd = {
 151      -            java, "-Xmx8m",
      151 +            java, "-Xmx8m", "-XX:+UsePerfData",
 152  152              "-classpath", System.getProperty("test.classes", "."),
 153  153              childClassName, uniqueID
 154  154          };
 155  155          final Process p = new ProcessBuilder(jobCmd).start();
 156  156  
 157  157          final String childPid =
 158  158              match(commandOutputOf(jps, "-m"),
 159  159                    "(?m)^ *([0-9]+) +\\Q"+childClassName+"\\E *"+uniqueID+"$", 1);
 160  160  
 161  161          final int n0 = objectsInUse(p, childPid, classToCheckForLeaks);
↓ open down ↓ 109 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX