tjiuming commented on PR #15033:
URL: https://github.com/apache/pulsar/pull/15033#issuecomment-1252553172

   @merlimat @AnonHxy @Jason918 
   For `CompositeByteBuf`, if the number of components in the buffer not 
exceeds `maxComponent`, it wound not resize/mem_copy. But if the capital is not 
enough and need a new component, all the components will merge(copy) into a new 
component.
   Here I use the default value of `maxComponent`, which is 16. Because I'm not 
sure what exact value to set.
   But on the whole, the buffer will be allocated lazily, which means fewer 
wasted memory. To some extent, it achieves the purpose of saving memory.
   To reduce mem_copy/resize, maybe we can calculate the certain value of 
`maxComponent` with `maxBatchSize`, is it required?


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