zongtanghu opened a new issue #522: 
org.apache.rocketmq.store.MappedFile#warmMappedFile() method has some 
Ineffective code and result double io in the sync flush
URL: https://github.com/apache/rocketmq/issues/522
 
 
   1.What is the purpose of the change?
   
   In the part of RocketMQ store,the goal of the warm-up mappedFile is that 
prewrite some random value into memory page corresponding to the mappedFile,so 
the target memory will swap to the physical memory in advance.But in fact,this 
action will result in double IO to the operation system.First IO is in the 
warm-up MappedFile,and secode IO is in the process of write message data into 
pagecache.
   
   2.Optimization change action
   Because of the above reason,we can remove the part of write some random 
value,prevent-gc and force flush codes in the warm-up method.In the 
mmapOperation,we can call mlock() method directly.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to