-
Notifications
You must be signed in to change notification settings - Fork 310
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
Not in focus GUI window causes high CPU utilization #226
Comments
Same issue here. When a wayland or x11 app is not in focus or is minimized my CPU usage jumps to 25%. At that point using
specs
Edit: Workaround: just hover the mouse cursor over the Minimize, Maximize, Close buttons of an unfocused window, the weston process goes to sleep and stops consuming CPU even if the app is not in focus. |
@hideyukn88 Were you able to repro this? After testing every WSLg version released I found this issue happens since WSLg 1.0.21. It looks like something from this commit is making increase indefinitely the CPU power usage when a linux app like xterm is not focused. |
@onomatopellan , yes, I am able to repro this issue, but it's not by focusing away from xterm window. The way I can repro is by minimizing xterm window, then CPU usage of weston reach 100% in top. I can spend sometime later day to take a look. thanks! |
FWIW (not interesting) what I saw with a fresh install last week was identical to how it's described. (I.e. once it kicks in, it goes up to ~10% or less until the mouse hovers back over the inactive window. Then it seems to go away.) |
(memo to myself) somehow file descriptor from FreeRDP's dynamic virtual channel message queue stay readable, thus Wayland display loop keep awake and calling RDP-backend to see any outstanding job, but since that message queue is empty, nothing done. WinPR's MessageQueue_Peek doesn't not reset (= read) fd if queue size is zero, thus fd stay readable. The possibility is some code is making that readable without actually queueing message. Update: issue is now understood. |
I can confirm this issue is fixed with latest weston commit. Thanks a lot! |
this happens, after wakeup from hibernation. So be aware of it. It happens to you, just read here: microsoft/WSL#6982 (comment) |
@thangamani-arun, would you please share log files from /mnt/wslg while this is happening? thanks! |
@hideyukn88 san: here are the logs, but I don't have the issue now. Idon't see any cpu usage at this moment. |
@thangamani-arun, thanks for quick response, but I don't see any clue other than below message logged in weston.log. Does this log continue to grow with these messages? thanks!
|
@hideyukn88 : I'm not sure. but as far as I remembers, When I try to launch Ubuntu-20.04 wsl app, It was keep blinking nothing was happening and it was hung and CPU usage was high. Then after some research I was able to kill and re-launched it without hanging issue. FYI. I was not able to shutdown the wsl from cmd.exe, the command was infinitely waiting. Hence I had to use |
@thangamani-arun, thanks for info, if it happens again, please take a log following the steps at https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method, and share with us, thanks! |
Environment
Steps to reproduce
Vmmem
CPU usage jumpI observed same behavior in Debian + Alacritty/st and Ubuntu + Xterm. On my machine usage jumps from ~0% to ~12%. Once the window is focused again the usage drops to ~0% again.
I also tried changing refresh rate from 144 to 60, but the cpu usage remains the same.
Expected behavior
No apparent CPU usage increase when not in focus.
Actual behavior
Higher CPU usage when out of focus compared to in focus.
When xterm window is focused:
When task manager is focused (snipping tool forces it to lose focus when capturing the image but the point remains the same)
The text was updated successfully, but these errors were encountered: