8237038: Shenandoah: Reduce thread pool size in TestEvilSyncBug.java test

Reviewed-by: shade
This commit is contained in:
Zhengyu Gu 2020-01-13 13:53:37 -05:00
parent 87c5a28403
commit 27d782be64

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2018, Red Hat, Inc. All rights reserved.
* Copyright (c) 2016, 2020, Red Hat, Inc. All rights reserved.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
@ -49,8 +49,9 @@ public class TestEvilSyncBug {
if (args.length > 0) {
test();
} else {
ExecutorService pool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
// Use 1/4 of available processors to avoid over-saturation.
int numJobs = Math.max(1, Runtime.getRuntime().availableProcessors() / 4);
ExecutorService pool = Executors.newFixedThreadPool(numJobs);
Future<?>[] fs = new Future<?>[NUM_RUNS];
for (int c = 0; c < NUM_RUNS; c++) {