2019 16" MBP running 10.15.4. WindowServer is eating a lot of CPU, idling at 10-20%-ish even with nothing much running. Fans are constantly going because of it.
I've disabled transparency and stopped (virtual) screens having their own spaces (as recommended elsewhere), to no avail. Also tried killing random things to see if anything sorts it out - no luck.
Running log stream --predicate '(process == "WindowServer")' --debug I can see it's dumping the following into its debug logs very frequently, 10+ times per second, which seems like it may be related:
2020-05-06 23:54:23.680073+0100 0x4e7 Debug 0x0 228 0 WindowServer: (CoreDisplay) [com.apple.CoreDisplay:default] [DEBUG] - On display 0x2b287853, surface is not detached, CoreDisplay is detached (0x00000000), DetachCode = 0
Any ideas what's going on?
Edit: as someone asked: The screens I was referring to are virtual screens. I do have an external monitor, but this still happens with it detached.
surface is not detachedin the--debuglog is supposed to mean? – jolvi May 18 '20 at 12:14IsAutoBrightnessEnabled:Yes, has been observed under Mojave. – jolvi May 18 '20 at 12:22sudo log config --process=$(pgrep WindowServer) --mode "level:off". Logging has stopped, but the CPU usage of WindowServer remains at 30%. – jolvi May 21 '20 at 10:44CGXSetDisplayPolicyEnabled: doEnable 1 : sleepRelated 0 : firstTime -1– Hari Honor Aug 10 '20 at 08:09log stream --debugcommand increases the WindowServer CPU usage visibly, you can tell by minimizing the Terminal it runs it. It draws a lot after all. Comparing with thetopcommand I found that the Activity Monitor does too! – MarcH Jun 29 '21 at 02:53