# HG changeset patch # User dl # Date 1507944877 25200 # Node ID 849e5737eb193b35bdd4780e3732af35fc94c4b1 # Parent 75ee0b48ea6318c735fa7dcd5a6b4c0cef7648bf 8188575: Miscellaneous changes imported from jsr166 CVS 2017-10 Reviewed-by: martin, psandoz diff -r 75ee0b48ea63 -r 849e5737eb19 test/jdk/java/util/concurrent/ConcurrentQueues/GCRetention.java --- a/test/jdk/java/util/concurrent/ConcurrentQueues/GCRetention.java Fri Oct 13 18:29:21 2017 -0700 +++ b/test/jdk/java/util/concurrent/ConcurrentQueues/GCRetention.java Fri Oct 13 18:34:37 2017 -0700 @@ -35,7 +35,7 @@ * @bug 6785442 * @summary Benchmark that tries to GC-tenure head, followed by * many add/remove operations. - * @run main GCRetention 12345 + * @run main GCRetention just-testing */ import static java.util.concurrent.TimeUnit.SECONDS; @@ -60,8 +60,8 @@ import java.util.Map; public class GCRetention { - // Suitable for benchmarking. Overridden by args[0] for testing. - int count = 1024 * 1024; + boolean benchmarkMode; + int count; /** No guarantees, but effective in practice. */ static void forceFullGc() { @@ -124,8 +124,9 @@ } void test(String[] args) { - if (args.length > 0) - count = Integer.valueOf(args[0]); + benchmarkMode = ! (args.length > 0 && args[0].equals("just-testing")); + count = benchmarkMode ? 1024 * 1024 : 30; + // Warmup for (Queue queue : queues()) test(queue); @@ -140,7 +141,7 @@ long t0 = System.nanoTime(); for (int i = 0; i < count; i++) check(q.add(Boolean.TRUE)); - forceFullGc(); + if (benchmarkMode) forceFullGc(); // forceFullGc(); Boolean x; while ((x = q.poll()) != null)