Skip to content

Commit

Permalink
[7.4.1] Correctly compute the number of threads to use for garbage co…
Browse files Browse the repository at this point in the history
…llection.

We want a lower bound, not an upper one.

PiperOrigin-RevId: 690593852
Change-Id: If391e695593c9d445b4968be98d05e6169a06b3a
  • Loading branch information
tjgq committed Oct 28, 2024
1 parent b86ef42 commit 60edba9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tools/diskcache/Gc.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 60edba9

Please sign in to comment.