merlimat commented on a change in pull request #10400:
URL: https://github.com/apache/pulsar/pull/10400#discussion_r621420500



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/EntryBatchIndexesAcks.java
##########
@@ -50,12 +51,20 @@ public void recycle() {
         handle.recycle(this);
     }
 
+    private void ensureCapacityAndReset(int entriesListSize) {
+        size = entriesListSize;
+        if (indexesAcks.length < size) {
+            indexesAcks = new Pair[size];
+        } else {
+            for (int i = 0; i < size; i++) {
+                indexesAcks[i] = null;

Review comment:
       Instead of setting to null here, it would be better to do it in the 
recycle so the instances of `Pair` are staying valid for a smaller amount of 
time.




-- 
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.

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


Reply via email to