WindowServer is eating lots of CPU, can’t work out why

catalinaperformance

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.

Best Answer

I have DELL UP3216Q external monitor. I had the same problem with "surface is not detached, CoreDisplay is detached" errors being spammed when I run log stream --predicate '(process == "WindowServer")' --debug. I'm using the external monitor with the Mac lid closed.

The errors stopped when I changed System Preferences > Displays > Display scaling settings so that scaling is not maximum on the external monitor. If I change the scaling back to maximum (more space) the errors start again on logging mode.

WindowServer CPU use was reduced slightly, but it is still around 30 %. Atleast the fan stopped spinning so fast.