danny0405 commented on code in PR #13232: URL: https://github.com/apache/hudi/pull/13232#discussion_r2065216860
########## hudi-common/src/main/java/org/apache/hudi/common/util/collection/ExternalSpillableMap.java: ########## @@ -221,7 +221,7 @@ public R put(T key, R value) { // At first, use the sizeEstimate of a record being inserted into the spillable map. // Note, the converter may over-estimate the size of a record in the JVM this.estimatedPayloadSize = keySizeEstimator.sizeEstimate(key) + valueSizeEstimator.sizeEstimate(value); - } else if (this.inMemoryMap.size() % NUMBER_OF_RECORDS_TO_ESTIMATE_PAYLOAD_SIZE == 0) { + } else if (this.currentInMemoryMapSize < this.maxInMemorySizeInBytes && this.inMemoryMap.size() % NUMBER_OF_RECORDS_TO_ESTIMATE_PAYLOAD_SIZE == 0) { Review Comment: Can we move the whole size estimation into the if clause 234 ~ 241, because only that part needs the `estimatedPayloadSize` to accumulate with the existing `currentInMemoryMapSize`. -- 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: commits-unsubscr...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org