Is anyone experiencing memory leaks with WindowServer?
Symptoms (macOS running 24h a day, no sleep, no session logout):
- WindowServer would slowly utilise more and more CPU usage and memory every day. From 5% CPU usage to 160% after 5 days.
- WindowServer would eat up all the memory available after several days.
- If WindowServer is not killed, the UI will eventually freeze or the OS will KP (caused by WindowServer).
- Closing all apps, user logout, etc. doesn't solve the issue (it doesn't reduce the CPU usage, and doesn't reduce memory consumption). WindowServer needs to be killed.
- Disconnecting monitors doesn't solve the issue.
- GPU Memory usage regularly reaches 75% then gets flushed down to 15%. Not sure what triggers those.
This is after 1 day of uptime (the last diagram is the GPU memory):
View attachment 514374
View attachment 514375
View attachment 514376
Ever since I've upgraded to RX 5700XT on Big Sur, I keep experiencing those memory leaks.
Every 5 days I have to reboot due to this issue. Which is very painful.
Samples of the process show that it's waiting for mach_msg_trap. Not sure what it's waiting for though...
Specs:
- Sapphire Nitro+ AMD Radeon RX 5700 XT 8G GDDR6 8 GB
- iMacPro1,1
- Big Sur 11.2.3 (20D91)
- 2x (DP and HDMI) 120Hz 1080p monitors
- 128GB of RAM
- Latest versions of OpenCore with WhateverGreen - Boot args: -v debug=0x100 keepsyms=1 alcid=1 agdpmod=pikera nv_disable=1
I've read online it might be due to the 120Hz monitors. So I believe something is wrong with the AMD drivers... This issue is driving me crazy.
Also, I found this:
https://chromeisbad.com/ &
https://twitter.com/lorenb/timelines/1338892756752732169
EDIT: 3 days 8 hours after deleting chrome and keystone, WindowServer ~18% CPU and 600MB of RAM. Seems promising. Let's see if it can last one week.
EDIT2: 5 days 21 hours after deleting chrome and keystone, WindowServer still ~18% CPU and 668MB of RAM. I think that was it... Chrome IS BAD.
EDIT3: 10 days 16 hours after deleting chrome and keystone, WindowServer still ~18% CPU and 698MB of RAM. It's a win! (btw, GPU memory spikes and flushes had nothing to do with the issue, it's still doing it, no noticeable impact on performances)
View attachment 515417
View attachment 515416
EDIT4: 14 days 15 hours, WindowServer ~37% CPU and 76GB of RAM. The issue is back... however, I've never this is the first time in a very long time it is able to last more than 7 days of uptime. I still believe deleting Chrome definitely helped, but Chrome/Keystone might not be the only processes to blame.