ShadowySpirits commented on code in PR #4903:
URL: https://github.com/apache/rocketmq/pull/4903#discussion_r967576347
##########
store/src/main/java/org/apache/rocketmq/store/logfile/DefaultMappedFile.java:
##########
@@ -548,15 +548,15 @@ public void warmMappedFile(FlushDiskType type, int pages)
{
}
// prevent gc
- if (j % 1000 == 0) {
- log.info("j={}, costTime={}", j, System.currentTimeMillis() -
time);
- time = System.currentTimeMillis();
- try {
- Thread.sleep(0);
- } catch (InterruptedException e) {
- log.error("Interrupted", e);
- }
- }
+ // if (j % 1000 == 0) {
+ // log.info("j={}, costTime={}", j, System.currentTimeMillis()
- time);
+ // time = System.currentTimeMillis();
+ // try {
+ // Thread.sleep(0);
Review Comment:
IMO, sleep(0) will give CPU time to another thread. These codes should not
be deleted to prevent high CPU usage of this warm-up loop.
--
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]