This is an automated email from the ASF dual-hosted git repository. jiangtian pushed a commit to branch fix_binary_allocator_test in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit a73ac902555e602ef738aaf4617ecd7c9fdabf37 Author: Tian Jiang <[email protected]> AuthorDate: Wed Jan 28 15:32:01 2026 +0800 Fix that the last binary in BinaryAllocator may not be evicted --- .../java/org/apache/iotdb/commons/binaryallocator/arena/Arena.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/binaryallocator/arena/Arena.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/binaryallocator/arena/Arena.java index 1a8a85ec370..b5d95234aa7 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/binaryallocator/arena/Arena.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/binaryallocator/arena/Arena.java @@ -216,7 +216,12 @@ public class Arena { private long resize() { average.update(); - int needRemain = (int) Math.ceil(average.average()) - getActiveSize(); + float averageActiveSize = average.average(); + if (averageActiveSize < 0.0001f) { + // avoid keeping the last binary forever + averageActiveSize = 0.0f; + } + int needRemain = (int) Math.ceil(averageActiveSize) - getActiveSize(); return evict(getQueueSize() - needRemain); }
