Skip to content

Commit

Permalink
Switch to fixed threads with 4 lower bound
Browse files Browse the repository at this point in the history
  • Loading branch information
rsalvador committed Oct 28, 2024
1 parent f4bb057 commit af155a3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ public final class DiskCacheGarbageCollectorIdleTask implements IdleTask {
private final DiskCacheGarbageCollector gc;

private static final ExecutorService executorService =
Executors.newThreadPerTaskExecutor(
Thread.ofVirtual().name("disk-cache-gc-", 0).factory());
Executors.newFixedThreadPool(
Math.max(4, Runtime.getRuntime().availableProcessors()),
new ThreadFactoryBuilder().setNameFormat("disk-cache-gc-%d").build());

private DiskCacheGarbageCollectorIdleTask(Duration delay, DiskCacheGarbageCollector gc) {
this.delay = delay;
Expand Down

0 comments on commit af155a3

Please sign in to comment.