This is an automated email from the ASF dual-hosted git repository. Caideyipi pushed a commit to branch patch-2094 in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 8bcc7ed26329e3cc559a91260343f2ee12e37c90 Author: Weihao Li <[email protected]> AuthorDate: Thu Apr 30 11:22:06 2026 +0800 modify release Signed-off-by: Weihao Li <[email protected]> (cherry picked from commit d1f2ee823f9abb5446f4173f1c2c85318d67a55a) (cherry picked from commit 2a6635b66e6cd8ad50beef00b5655415b1221853) --- .../apache/iotdb/commons/memory/AtomicLongMemoryBlock.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/memory/AtomicLongMemoryBlock.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/memory/AtomicLongMemoryBlock.java index 1a7d3c25413..7f144e5d0d6 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/memory/AtomicLongMemoryBlock.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/memory/AtomicLongMemoryBlock.java @@ -104,15 +104,13 @@ public class AtomicLongMemoryBlock extends IMemoryBlock { long next; do { prev = usedMemoryInBytes.get(); - if (sizeInByte > prev) { - LOGGER.warn( - "The memory cost to be released is larger than the memory cost of memory block {}", - this); - next = 0; - } else { - next = prev - sizeInByte; - } + next = sizeInByte > prev ? 0 : prev - sizeInByte; } while (!usedMemoryInBytes.compareAndSet(prev, next)); + if (sizeInByte > prev) { + // print log after compareAndSet was success + LOGGER.warn( + "The memory cost to be released is larger than the memory cost of memory block {}", this); + } return next; }
