Skip to content
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

time: time.Timer with large duration causes 100% CPU usage on Intel 32-bit #5063

Closed
kisielk opened this issue Mar 16, 2013 · 3 comments
Closed

Comments

@kisielk
Copy link
Contributor

kisielk commented Mar 16, 2013

What steps will reproduce the problem?
http://play.golang.org/p/wpNOzCVSr9

What is the expected output?
Idle CPU

What do you see instead?
In the output of top the process has 100% CPU usage.

Which compiler are you using (5g, 6g, 8g, gccgo)?
8g

Which operating system are you using?
Ubuntu 12.04

Which version are you using?  (run 'go version')
go version devel +b5b5c246be0c Fri Mar 15 17:08:07 2013 -0700 linux/386

If the divisor is changed to 1.44 or larger, the process does not use 100% CPU.

Here's a profile from a slightly different program that was waiting on such a timer:

(pprof) top
Total: 80 samples
      25  31.2%  31.2%       37  46.2% runtime.entersyscallblock
      15  18.8%  50.0%       76  95.0% timerproc
      10  12.5%  62.5%       10  12.5% releasep
       8  10.0%  72.5%        8  10.0% runtime.nanotime
       6   7.5%  80.0%        6   7.5% runtime.noteclear
       5   6.2%  86.2%        5   6.2% runtime.xchg
       4   5.0%  91.2%        9  11.2% runtime.lock
       3   3.8%  95.0%        3   3.8% runtime.setprof
       1   1.2%  96.2%        1   1.2% runtime.exitsyscall
       1   1.2%  97.5%        1   1.2% runtime.getcallersp
@remyoudompheng
Copy link
Contributor

Comment 1:

https://golang.org/cl/7876043

Status changed to Started.

@kisielk
Copy link
Contributor Author

kisielk commented Mar 16, 2013

Comment 2:

I grabbed the patch with clpatch and tried my original code with it as well as that from
the playground link, it works as expected now.

@remyoudompheng
Copy link
Contributor

Comment 3:

This issue was closed by revision ba50e4f.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants