-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HashedWheelTimer cost too many CPU time on windows #9710
Milestone
Comments
@michaelmao999 can you provide a PR to fix this ? |
normanmaurer
added a commit
that referenced
this issue
Oct 25, 2019
…d a tickDuration of 1 Motivation: We do not correct guard against the gact that when applying our workaround for windows we may end up with a 0 sleep period. In this case we should just sleep for 1 ms. Modifications: Guard agains the case when our calculation will produce 0 as sleep time on windows Result: Fixes #9710.
@michaelmao999 can you check #9714... This should fix it. |
normanmaurer
added a commit
that referenced
this issue
Oct 25, 2019
…d a tickDuration of 1 Motivation: We do not correct guard against the gact that when applying our workaround for windows we may end up with a 0 sleep period. In this case we should just sleep for 1 ms. Modifications: Guard agains the case when our calculation will produce 0 as sleep time on windows Result: Fixes #9710.
normanmaurer
added a commit
that referenced
this issue
Oct 25, 2019
…d a tickDuration of 1 (#9714) Motivation: We do not correct guard against the gact that when applying our workaround for windows we may end up with a 0 sleep period. In this case we should just sleep for 1 ms. Modifications: Guard agains the case when our calculation will produce 0 as sleep time on windows Result: Fixes #9710.
normanmaurer
added a commit
that referenced
this issue
Oct 25, 2019
…d a tickDuration of 1 (#9714) Motivation: We do not correct guard against the gact that when applying our workaround for windows we may end up with a 0 sleep period. In this case we should just sleep for 1 ms. Modifications: Guard agains the case when our calculation will produce 0 as sleep time on windows Result: Fixes #9710.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When tickDuration is set to 1, sleep time will be ignore in waitForNextTick on HashedWheelTimer, it will waste CPU time to perform waitForNextTick again and agin.
JVM version (e.g.
java -version
)OS version (e.g.
uname -a
) windows 10Here, I just post workaround for your reference.
if (Platform.isWindows()) {
sleepTimeMs = sleepTimeMs / 10 * 10;
if (sleepTimeMs == 0) {
sleepTimeMs = 1;
}
}
The text was updated successfully, but these errors were encountered: