franz1981 edited a comment on pull request #3370:
URL: https://github.com/apache/activemq-artemis/pull/3370#issuecomment-739480817


   @gemmellr I suppose that the Netty ByteBuf behaviour in case the buffer is 
enlarged can (and should) be fixed for AMQP as well:
   TLDR if you got a 32K msg and write a single byte into it, Netty will 
enlarge it to be the next power of 2 capacity ie 64K, wasting ~50% of its space 
in case the message will sit on the queue awaiting it to be sent.
   
   I've "solved" this by forcing Netty to know upfront the desired required 
capacity and use 
https://netty.io/4.0/api/io/netty/buffer/ByteBuf.html#capacity-int- to size it 
upfront (instead of `ensureWritable`)


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