From 60edba93f76ae406ad627b21ea21eb53da27bd7e Mon Sep 17 00:00:00 2001 From: Googler Date: Mon, 28 Oct 2024 06:56:24 -0700 Subject: [PATCH] [7.4.1] Correctly compute the number of threads to use for garbage collection. We want a lower bound, not an upper one. PiperOrigin-RevId: 690593852 Change-Id: If391e695593c9d445b4968be98d05e6169a06b3a --- src/tools/diskcache/Gc.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/diskcache/Gc.java b/src/tools/diskcache/Gc.java index c678e5bfeb9258..04eeed4d810ad2 100644 --- a/src/tools/diskcache/Gc.java +++ b/src/tools/diskcache/Gc.java @@ -13,7 +13,7 @@ // limitations under the License. package diskcache; -import static java.lang.Math.min; +import static java.lang.Math.max; import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.google.devtools.build.lib.remote.disk.DiskCacheGarbageCollector; @@ -75,7 +75,7 @@ public static final class Options extends OptionsBase { private static final ExecutorService executorService = Executors.newFixedThreadPool( - min(4, Runtime.getRuntime().availableProcessors()), + max(4, Runtime.getRuntime().availableProcessors()), new ThreadFactoryBuilder().setNameFormat("disk-cache-gc-%d").build()); public static void main(String[] args) throws Exception {