maoyiyong-svg opened a new issue, #4829:
URL: https://github.com/apache/rocketmq/issues/4829

   
在org.apache.rocketmq.store.MappedFile#commit0中使用“this.fileChannel.write(byteBuffer);”导致没有利用文件内存映射机制,导致写入效率降低。
   原因:
   
在MappedFile对象实例化的时候就会实例化fileChannel和MappedByteBuffer,完成之后在finally中可以直接关闭fileChannel,之后的数据读写应该使用MappedByteBuffer,通过文件内存映射来操作。
   
![image](https://user-images.githubusercontent.com/62745186/185017246-044241e1-5703-434b-a8e8-5946d66af6ae.png)
   此处建议使用mappedByteBuffer进行数据写入。
   
![image](https://user-images.githubusercontent.com/62745186/185020982-007dbe10-ad61-45e3-99e7-670b93aef5e4.png)
   


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