You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/10/19 05:31:18 UTC

[GitHub] [pulsar] AnonHxy commented on a diff in pull request #17936: [fix][client] Reserve allocated buffer in BatchMessageContainer on client memory limitation.

AnonHxy commented on code in PR #17936:
URL: https://github.com/apache/pulsar/pull/17936#discussion_r998957347


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/BatchMessageContainerImpl.java:
##########
@@ -293,14 +302,27 @@ public OpSendMsg createOpSendMsg() throws IOException {
                 messageMetadata.getHighestSequenceId(), numMessagesInBatch, messageMetadata, encryptedPayload);
 
         OpSendMsg op = OpSendMsg.create(messages, cmd, messageMetadata.getSequenceId(),
-                messageMetadata.getHighestSequenceId(), firstCallback);
+                messageMetadata.getHighestSequenceId(), firstCallback, batchAllocatedSizeBytes);
 
         op.setNumMessagesInBatch(numMessagesInBatch);
         op.setBatchSizeByte(currentBatchSizeBytes);
         lowestSequenceId = -1L;
         return op;
     }
 
+    private void reserveBatchAllocatedSizeWhenInit(int batchAllocatedInitSize) {

Review Comment:
   Greate.  I have updated the two methods as  one method `updateAndReserveBatchAllocatedSize` 



-- 
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-unsubscribe@pulsar.apache.org

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