diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index 3c494cfcc..c35bad84f 100644 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -897,6 +897,9 @@ class VanillaChronicleMap, } int alloc(int blocks) { + if (blocks > MAX_ENTRY_OVERSIZE_FACTOR) + throw new IllegalArgumentException("Entry is too large: requires " + blocks + + " entry size chucks, " + MAX_ENTRY_OVERSIZE_FACTOR + " is maximum."); int ret = (int) freeList.setNextNContinuousClearBits(nextPosToSearchFrom, blocks); if (ret == DirectBitSet.NOT_FOUND) {