8081734: ConcurrentHashMap/ConcurrentAssociateTest.java, times out 90% of time on sparc with 256 cpu.
authordarcy
Mon, 20 Jul 2015 15:13:50 -0700
changeset 31807 3bd38a739ea1
parent 31806 1af94721a340
child 31808 9fdbb78f30a4
child 31815 418e0d8d9b09
8081734: ConcurrentHashMap/ConcurrentAssociateTest.java, times out 90% of time on sparc with 256 cpu. Reviewed-by: chegar
jdk/test/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java
--- a/jdk/test/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java	Mon Jul 20 13:11:20 2015 -0700
+++ b/jdk/test/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java	Mon Jul 20 15:13:50 2015 -0700
@@ -120,7 +120,8 @@
             }
         };
 
-        int ps = Runtime.getRuntime().availableProcessors();
+        // Bound concurrency to avoid degenerate performance
+        int ps = Math.min(Runtime.getRuntime().availableProcessors(), 32);
         Stream<CompletableFuture> runners = IntStream.range(0, ps)
                 .mapToObj(i -> sr.get())
                 .map(CompletableFuture::runAsync);