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

Constant CPU usage on macOS 10.15.5 #472

Closed
2 tasks done
danielzuegner opened this issue Aug 17, 2020 · 5 comments
Closed
2 tasks done

Constant CPU usage on macOS 10.15.5 #472

danielzuegner opened this issue Aug 17, 2020 · 5 comments
Labels

Comments

@danielzuegner
Copy link

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Issue

I've just started using ActivityWatch on macOS 10.15.5. I've noticed that when AW runs, the process "System-Events" continuously uses ~15% CPU on my MacBook Pro 13" 2015 (see screenshot), and even leads to the fans constantly spinning quite audibly in clamshell mode.

~15% CPU

Disabling aw-watcher-window made the CPU usage drop to almost zero.

Is this normal behavior? Is there anything I can do to reduce the CPU usage but still track my usage?

@johan-bjareholt
Copy link
Member

Probably related to this? ActivityWatch/aw-watcher-window#45

@danielzuegner
Copy link
Author

danielzuegner commented Aug 18, 2020

Thanks for your reply. I've had a brief look a the issue you mentioned. I checked my Console log, and there are no similar messages to the ones in the other issue. The process "System Events" (with high CPU usage for me) emits these messages roughly every 2 seconds (not sure if relevant):

activitywatch3

@danielzuegner
Copy link
Author

It seems like the CPU usage increases with the number of windows / tabs, is that possible? Closing all windows made the CPU usage drop to ~3-5%, and re-opening some windows gradually adds CPU load (as it seems).

@johan-bjareholt
Copy link
Member

It seems like the CPU usage increases with the number of windows / tabs, is that possible?

The thing is that this is very hard for us to know because it's not ActivityWatch itself taking up the CPU resources but a macOS process which is not open source.

The only thing I know is that our way of getting the focused window with aw-watcher-window only asks for the focused window, whether macOS internally needs to iterate over all windows to find that however we can't know.

As stated in the other PR though there's a PR to rewrite the whole macOS backend for aw-watcher-window which hopefully will make things more reliable, I think that's our best shot at improving/fixing this. ActivityWatch/aw-watcher-window#40

@stale
Copy link

stale bot commented Feb 14, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 14, 2021
@stale stale bot closed this as completed Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants