-
Notifications
You must be signed in to change notification settings - Fork 22
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
High CPU usage when idle #40
Comments
Here's the flamegraph SVG, renamed to .svg.txt because github doesn't recognize the file type. |
Thanks for excellent data, and sorry for letting you wait. This bug was triggered by a problem with your key bindings file; watch out for ncmpc's error messages. |
Thanks! When I start it, it just prints a couple lines like "Key Ctrl-N assigned to scroll-down-line and down", but those didn't register as error messages to me. They're quickly replaced by the UI. My keybinding file has been basically unchanged since 2008 (if not earlier: that's when I imported my homedir into git...), so it's not surprising that there's something missing / with slightly different meaning. I confirmed that if I rename my keybindings file so it starts without any configuration, the high CPU usage goes away. 👍 I guess this didn't happen when run as root because root doesn't have an ncmpc config at all. |
It looks like just having multiple bindings associated with the same key was the problem, specifically. Working great now, thanks again. |
That was not the problem; the problem was a bug, but it was only triggered by your configuration error. The bug is solved (no high CPU usage anymore even if your config is bad). |
Oh, I meant the problem with my config file -- I was curious what it was about my config file that had been triggering the underlying bug. |
I have a similar problem with the search functionality: starting a search (by pressing I have this bug with both the current GitHub version and |
@hiqua new issue (with perf report). |
After updating mpd and ncmpc, I noticed that ncmpc is using >80% CPU -- it seems to be endlessly looping when idle.
Since I update fairly often, this was probably introduced in the 0.33 release. (It could have been in 0.32, but anything older would be unlikely.)
Versions:
Running Void Linux:
The strace log has sending an
"idle\n"
to adup
'd IPv6 socket to::1
:and then it goes into a loop of running this over and over, as fast as it can:
aside from the high CPU usage, ncmpc remains responsive.
I used perf to make a flamegraph, and it suggests that
Instance:OnCheckKeyBindings
,KeyBindings::Check
,KeyBindings::FindKey
... is the sequence of calls where it's spending nearly all its time. Also, I noticed that the high CPU usage does not appear when run as root, but I don't see anEACCESS
or other permission failures in the strace log suggesting why that makes a difference.Please let me know if there's any other specific information I could add -- I can reproduce this pretty easily, but I'm not very familiar with modern C++ or the boost APIs. Hopefully these details are enough to point you in the right direction.
The text was updated successfully, but these errors were encountered: