Skip to content

Commit 35d219b

Browse files
SendaoYanjerboaa
authored andcommitted
8081734: ConcurrentHashMap/ConcurrentAssociateTest.java, times out 90% of time on sparc with 256 cpu.
Backport-of: 6e48caf2507d4a45e1861ee699a32a5e459d70c2
1 parent d0281be commit 35d219b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

jdk/test/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ private static void testOnce(String desc, BiConsumer<ConcurrentMap<Object, Objec
120120
}
121121
};
122122

123-
int ps = Runtime.getRuntime().availableProcessors();
123+
// Bound concurrency to avoid degenerate performance
124+
int ps = Math.min(Runtime.getRuntime().availableProcessors(), 32);
124125
Stream<CompletableFuture> runners = IntStream.range(0, ps)
125126
.mapToObj(i -> sr.get())
126127
.map(CompletableFuture::runAsync);

0 commit comments

Comments
 (0)