SteveYurongSu commented on code in PR #14375:
URL: https://github.com/apache/iotdb/pull/14375#discussion_r1884975370


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/LocalExecutionPlanner.java:
##########
@@ -295,6 +295,19 @@ public synchronized void reserveFromFreeMemoryForOperators(
 
   public synchronized void releaseToFreeMemoryForOperators(final long 
memoryInBytes) {
     freeMemoryForOperators += memoryInBytes;
+
+    if (freeMemoryForOperators > ALLOCATE_MEMORY_FOR_OPERATORS) {
+      LOGGER.error(
+          "The free memory released is more than allocated memory, free 
memory:{} released memory: {},allocated memory:{}",
+          freeMemoryForOperators,
+          memoryInBytes,
+          ALLOCATE_MEMORY_FOR_OPERATORS);
+
+      throw new MemoryNotEnoughException(
+          String.format(
+              "The memory released is more than allocated memory, released 
memory: %d, allocated memory: %d",
+              memoryInBytes, ALLOCATE_MEMORY_FOR_OPERATORS));
+    }

Review Comment:
   ```suggestion
         LOGGER.error(
             "The free memory {} is more than allocated memory {}, last 
released memory: {}",
             freeMemoryForOperators,
             ALLOCATE_MEMORY_FOR_OPERATORS,
             memoryInBytes);
       }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to