From 16bd3b263b317e1e932f4d5291b6447458d88154 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Mon, 6 Sep 2021 15:08:07 +0200 Subject: [PATCH] Limit cached indexwriters --- .../dbengine/database/disk/PooledIndexSearcherManager.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/it/cavallium/dbengine/database/disk/PooledIndexSearcherManager.java b/src/main/java/it/cavallium/dbengine/database/disk/PooledIndexSearcherManager.java index 5a1c17c..bb58c8b 100644 --- a/src/main/java/it/cavallium/dbengine/database/disk/PooledIndexSearcherManager.java +++ b/src/main/java/it/cavallium/dbengine/database/disk/PooledIndexSearcherManager.java @@ -61,6 +61,8 @@ public class PooledIndexSearcherManager { this.cachedSnapshotSearchers = CacheBuilder.newBuilder() .expireAfterWrite(queryRefreshDebounceTime) + // Max 3 cached non-main index writers + .maximumSize(3) .build(new CacheLoader<>() { @Override public Mono load(@NotNull LLSnapshot snapshot) {