# HG changeset patch # User zgu # Date 1578939259 18000 # Mon Jan 13 13:14:19 2020 -0500 # Node ID 4a873cdbce06da19c24d43f5d5ca57926a8c2ead # Parent 9338d0f52b2ebb5ea7ff7c5af8c4db150e88dcac 8237038: Shenandoah: Reduce thread pool size in TestEvilSyncBug.java test diff --git a/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java b/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java --- a/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java @@ -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,10 @@ if (args.length > 0) { test(); } else { - ExecutorService pool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); - + // Use 1/4 of available processors to avoid over provisioning thread pool on many core + // systems. + int numProcessors = Runtime.getRuntime().availableProcessors(); + ExecutorService pool = Executors.newFixedThreadPool(Math.max(1, numProcessors / 4)); Future[] fs = new Future[NUM_RUNS]; for (int c = 0; c < NUM_RUNS; c++) {