changeset 57666:b2054fde257e

8237038: Shenandoah: Reduce thread pool size in TestEvilSyncBug.java test Reviewed-by: shade
author zgu
date Mon, 13 Jan 2020 13:53:37 -0500
parents ac190703e3f2
children 57f0df0ce2c6
files test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java	Mon Jan 13 18:39:51 2020 +0100
+++ b/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java	Mon Jan 13 13:53:37 2020 -0500
@@ -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 @@
         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++) {