WindowServer memory leak

Looks like this problem is coming back in High Sierra.


I have a late 2013 MacBook Pro Retina, freshly installed High Sierra after resetting SMC, PRAM, at most 6 apps open at the same time, after 16 hours, this WindowServer process is taking almost 1GB RAM! Notice how much has been compressed. Several days ago, I have been using the High Sierra GM for about a week without rebooting/logging out, and I noticed this WindowServer process took 8GB RAM!


User uploaded file

MacBook Pro with Retina display, OS X El Capitan (10.11)

Posted on Sep 27, 2017 8:50 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 3, 2017 10:25 AM

Well, looks like the current consensus of the bug is that for retina display with Intel graphics card, if the resolution is set to the "scaled max", you will get the WindowServer memory leak. Other resolutions seem to be fine.


On my late 2013 rMBP 13'', setting the display to "scaled max (1680x1050)" will instantly create the memory leak. Other "scaled settings", currently at 1440x900, WindowServer stays around 100MB for 24 hours now.

53 replies
Question marked as Top-ranking reply

Oct 3, 2017 10:25 AM in response to Morgon-

Well, looks like the current consensus of the bug is that for retina display with Intel graphics card, if the resolution is set to the "scaled max", you will get the WindowServer memory leak. Other resolutions seem to be fine.


On my late 2013 rMBP 13'', setting the display to "scaled max (1680x1050)" will instantly create the memory leak. Other "scaled settings", currently at 1440x900, WindowServer stays around 100MB for 24 hours now.

Oct 2, 2017 11:58 AM in response to CongGao

This seems to work! I tested it for a bit and the default setting and the second highest setting for Scaled Resolution seems to not have a memory leak. Only when putting it to the highest "More Space" option on my 2013 13inch rMBP does windowserver memory leak. But switching to the default resolution doesn't "release" memory if you had it on "More Space" prior, it just doesn't leak more. I hope Apple fixes it soon.


Awesome work, CongGao!

Nov 1, 2017 3:31 AM in response to KitsuneNoBaka

10.13.1 didn't fix a thing for me. With any of Apple's display settings the graphics stutter and a re sluggish.


What did "fix" things was a command line utility called screen-resolution-switcher where I could set the screen's resolution of my 15" MBP to 2048x1280. With this, everything is smooth again and windowserver's memory use is kept in check. The only thing that's not quite there is that fonts look a tiny bit nicer with Apple's resolutions, but that's a cheap price to pay.

Nov 29, 2017 1:16 AM in response to welsonsun

I was seeing thousands of these messages in the logs as well, even after updating to latest beta:

com.apple.xpc.launchd[1] (com.apple.preference.displays.MirrorDisplays): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.


and noticed that they went away for me when I disabled the third party utility (SwitchresX) I was using to manage my external monitor's resolution and rebooted. My current config is:


Macbook Pro (Retina 15-inch, Late 2013)

10.13.2 Beta (17C83a)

16GB RAM

Automatic graphics switching UNchecked in Energy Saver pref pane

Clamshell mode with external Samsung U28E590 - Resolution: 3200 x 1800 @ 60 Hz, connected from thunderbolt port to Display port of monitor (not hdmi)

Sep 27, 2017 9:44 AM in response to welsonsun

8GB seems over the top, but 1GB is perfectly ok.

In my limited testing, I see no indication of memory leak. The memory usage goes up and down as applications are launched and quit, and windows are created and destroyed.

If there is a memory leak, it is likely not in WindowServer itself, but in one or more applications - WindowServer, as the name indicates, *serves* other processes when they request the creation or deletion of windows.

If an application does not properly dispose of windows once they are closed, it may have a memory leak that causes what you experience.


I suggest you make a note of the applications that are running to try and figure out if this problem happens consistently with one application.

Oct 3, 2017 10:30 AM in response to welsonsun

Well, looks like the current consensus of the bug is that for retina display with Intel graphics card, if the resolution is set to the "scaled max", you will get the WindowServer memory leak. Other resolutions seem to be fine.

No, in my case it happens with the "middle" scaled option (doubled 1680x1050), so the 10.13.1 finding is definitely a good sign.

Nov 7, 2017 3:42 AM in response to Kudose

Kudose wrote:


I noticed this issue when my MPB started to slow down ... WindowServer was using 38GB of RAM on my MBP (2.2 GHz Intel Core i7, 16 GB 1600 MHz DDR3). I enrolled in the beta program and while the problem is not as significant (some memory is reclaimed) it still exists on 10.13.2 Beta, but is nothing in comparison to before. It currently peaks at 168.3MB and then reclaims a few MB down to ~164MB and repeats.


If the memory usage of Window Server stays, as you say, within 164-169MB then it's probably fixed. That is a pretty reasonable amount of RAM.

Sep 28, 2017 3:17 AM in response to welsonsun

welsonsun wrote:


There are tons of:


Sep 27 17:10:20 welsons-mbp com.apple.xpc.launchd[1] (com.apple.preference.displays.MirrorDisplays): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.


In my system.log.


Something is crashing all the time?

So it seems.


Do you have an external display? Which one?

Do you have some third party program to handle extra resolutions of the display?


Do the crashes also occur if running with just the MBP display?

Nov 6, 2017 12:26 PM in response to welsonsun

I noticed this issue when my MPB started to slow down ... WindowServer was using 38GB of RAM on my MBP (2.2 GHz Intel Core i7, 16 GB 1600 MHz DDR3). I enrolled in the beta program and while the problem is not as significant (some memory is reclaimed) it still exists on 10.13.2 Beta, but is nothing in comparison to before. It currently peaks at 168.3MB and then reclaims a few MB down to ~164MB and repeats.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

WindowServer memory leak

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.