diff --git a/code/features-index/lexicon/src/main/java/nu/marginalia/dict/DictionaryMap.java b/code/features-index/lexicon/src/main/java/nu/marginalia/dict/DictionaryMap.java index 64bd8030..dc904441 100644 --- a/code/features-index/lexicon/src/main/java/nu/marginalia/dict/DictionaryMap.java +++ b/code/features-index/lexicon/src/main/java/nu/marginalia/dict/DictionaryMap.java @@ -4,12 +4,7 @@ public interface DictionaryMap { int NO_VALUE = Integer.MIN_VALUE; static DictionaryMap create() { - if (!Boolean.getBoolean("large-ram")) { - return new OnHeapDictionaryMap(); - } - else { - return new OffHeapDictionaryHashMap(1L << 31); - } + return new OnHeapDictionaryMap(); } int size(); diff --git a/code/features-index/lexicon/src/main/java/nu/marginalia/dict/OnHeapDictionaryMap.java b/code/features-index/lexicon/src/main/java/nu/marginalia/dict/OnHeapDictionaryMap.java index 067c2cdc..3b70e7e4 100644 --- a/code/features-index/lexicon/src/main/java/nu/marginalia/dict/OnHeapDictionaryMap.java +++ b/code/features-index/lexicon/src/main/java/nu/marginalia/dict/OnHeapDictionaryMap.java @@ -3,7 +3,8 @@ package nu.marginalia.dict; import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap; public class OnHeapDictionaryMap implements DictionaryMap { - private final Long2IntOpenHashMap entries = new Long2IntOpenHashMap(100_000, 0.75f); + private static final int DEFAULT_SIZE = Integer.getInteger("lexiconSizeHint", 100_000); + private final Long2IntOpenHashMap entries = new Long2IntOpenHashMap(DEFAULT_SIZE, 0.75f); @Override public int size() {