franz1981 commented on a change in pull request #3223:
URL: https://github.com/apache/activemq-artemis/pull/3223#discussion_r456498525



##########
File path: 
artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFile.java
##########
@@ -271,7 +271,7 @@ protected ByteBuffer newBuffer(int size, int limit) {
       public void flushBuffer(final ByteBuf byteBuf, final boolean 
requestedSync, final List<IOCallback> callbacks) {
          final int bytes = byteBuf.readableBytes();
          if (bytes > 0) {
-            final ByteBuffer buffer = newBuffer(byteBuf.capacity(), bytes);
+            final ByteBuffer buffer = newBuffer(byteBuf.capacity(), bytes, 
false);

Review comment:
       > . I'm afraid this could not cleanup the rest of the 4K
   
   In the original code of ASYNCIO it was already non clearing the rest of 4K 
bytes, see 
https://github.com/apache/activemq-artemis-native/blob/master/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/LibaioContext.java#L134
   The original.code was clearing just the required new capacity (that's 300 in 
your example).
   
   > Also: did you run the whole test suite on such change?
   
   Yet to do it, will do it now :)
   NIO and MAPPED already use this optimization from long time (the jira link 
explain it): ASYNCIO was the only one missing yet




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