jsancio commented on code in PR #12625:
URL: https://github.com/apache/kafka/pull/12625#discussion_r968998063


##########
raft/src/main/java/org/apache/kafka/raft/internals/BatchMemoryPool.java:
##########
@@ -72,7 +74,13 @@ public void release(ByteBuffer previouslyAllocated) {
                     + previouslyAllocated.limit());
             }
 
-            free.offer(previouslyAllocated);
+            // Free the buffer if the number of pooled buffers is already the 
maximum number of batches.
+            // Otherwise return the buffer to the memory pool.
+            if (free.size() >= maxBatches) {

Review Comment:
   Yes. Fixed the variable name.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to