MacBook Air memory leaks following the Sonoma Update

Any updates on when Apple will address the MAJOR issue of memory leaks ( AGAIN, this happened in Montery also ) on MacOS Sonoma, I have had nothing but crashes caused by memory leaks since upgrading and have several clients with BRAND NEW iMAC's and MACBook Air units with the same issues. This is CRAZY and Apple should have nevre released an OS with this BUG, especially since this is NOT the first time this has been an issue. Is anyone at Apple testing thigns anymore ?


[Re-Titled By Moderator]

MacBook Air (M1, 2020)

Posted on Oct 17, 2023 11:41 AM

Reply
Question marked as Top-ranking reply

Posted on May 23, 2024 4:23 PM

I've found a reliable way to reproduce this issue. I was working with Metal 3 to port my game engine to macOS, and noticed major memory leaks while resizing the application window. After hours of debugging I figured I might just revisit the "Hello Triangle" example directly from Apple. That leaked memory too.


So, for anyone with the will to reproduce this issue:

  • Obtain the official "Hello Triangle" Metal example from using_a_render_pipeline_to_render_primitives
  • Use a MacBook (maybe a Mac Studio is also affected?) with external monitors.
  • Resize the "Hello Triangle" window on an external monitor.


A few notes:

It does not happen when resizing the application on the built-in monitor.

My monitors are both 4K@240Hz (32GS95UE-B), which may be another factor important for this?

I am using HDMI 2.1 on one and DP 1.4 on the other, and both suffer from this issue.

The issue disappears if I comment out the `presentDrawable` call in the "Hello Triangle" example.


I would also like to make clear that I have resized the official "Hello Triangle" example application so much, that it ended up locking up my system (making my cursor stutter, music choppy, and inevitably freezing forcing me to do a full restart).


Hopefully this information allows for a prompt fix. I also own a Mac Studio with an M2 Ultra, which I will be testing this on shortly, so I might edit or follow up to specify if this is a laptop-specific issue.

33 replies
Question marked as Top-ranking reply

May 23, 2024 4:23 PM in response to lloyd_dawson

I've found a reliable way to reproduce this issue. I was working with Metal 3 to port my game engine to macOS, and noticed major memory leaks while resizing the application window. After hours of debugging I figured I might just revisit the "Hello Triangle" example directly from Apple. That leaked memory too.


So, for anyone with the will to reproduce this issue:

  • Obtain the official "Hello Triangle" Metal example from using_a_render_pipeline_to_render_primitives
  • Use a MacBook (maybe a Mac Studio is also affected?) with external monitors.
  • Resize the "Hello Triangle" window on an external monitor.


A few notes:

It does not happen when resizing the application on the built-in monitor.

My monitors are both 4K@240Hz (32GS95UE-B), which may be another factor important for this?

I am using HDMI 2.1 on one and DP 1.4 on the other, and both suffer from this issue.

The issue disappears if I comment out the `presentDrawable` call in the "Hello Triangle" example.


I would also like to make clear that I have resized the official "Hello Triangle" example application so much, that it ended up locking up my system (making my cursor stutter, music choppy, and inevitably freezing forcing me to do a full restart).


Hopefully this information allows for a prompt fix. I also own a Mac Studio with an M2 Ultra, which I will be testing this on shortly, so I might edit or follow up to specify if this is a laptop-specific issue.

Dec 3, 2023 9:33 AM in response to lloyd_dawson

I'm also seeing MAJOR memory leak with Sonoma, major one being "WindowServer".

The conclusion of the many tests I've done the last couple days to track this down (because it annoyed me so much) is that it is linked to external monitors.

MacOS freshly rebooted not connected to an external monitors does not exhibit such issue.

Then I connect my external monitor (Dell UltraSharp 32 6K Monitor - U3224KA - native res i.e. no scaling), do not start anything (especially the buggy DDPM Dell tool), leave it doing nothing over 1 full night and 1 full day and WindowServer process is showing up around 9GB (coming from less than 1GB before when no external monitor was connected).

Because I have the M3 Max with 128Gb, I noticed this when, with my traditional workflow, all my memory tools showed me that the system was using swap, was compressing memory already, and memory pressure was constantly increasing.

Over 1 or 2 weeks (or even less) WindowServer was easily consuming a whopping 200GB!

App Memory was showing that almost all my RAM was consumed despite no other process than WindowServer was showing abnormal amounts of RAM usage.

This is driving me crazy.

Mar 4, 2024 11:29 PM in response to matherman

Are you using an external display? All my tests exhibiting memory leaks (and huge ones) were on process WindowServer and exclusively using an external monitor. I could even have that process go up to 150GB easily if I watch full screen videos / YouTube on the external monitor.


Exact same usage without the external monitor connected runs just fine without any leak at all.


Very frustrating as I need to reboot the Mac multiple times in a week depending on what I've been doing - which I never did before.

Mar 7, 2024 1:05 AM in response to Luis Sequeira1

Good news here: just updated to MacOS 14.4 and so far so good.

Looks a lot better.

Will report here if the issue still happens over time but initial tests do not exhibit the memory leak when playing some full screen videos on external monitor whereas it was immediately occurring with 14.3.1.

Apparently it took Apple 4 versions at least to fix it, which is unbelievable if you ask me!

Mar 5, 2024 4:01 AM in response to fred-nbs

fred-nbs wrote:

True in most occasions.
But there is definitively something abnormal with the handling of external monitors.

https://discussions.apple.com/content/attachment/3d65734f-c061-4a0a-9421-9a060fad173d

50+GB for WindowServer process it keeps growing to the point where my 128GB RAM M3Max it getting slower, use more & more compressed memory and swaps.

Only a reboot cures it.
This does not happen when working not connected to an external monitor.


I agree, this is not normal.


I wonder if this problem is somehow related to a problem some users have with Quicktime Player with external displays.

What cables/adapters are you using to connect the display? There appears to be a problem with Apple's own multiport AV adapter.

FWIW, I work with an external display all day long, using a third party USB-C dock with HDMI port, or a direct USB-C to HDMI or HDMI to VGA adapter, depending (I teach on a lot of different rooms with different hardware). I have never had this Window Server gobbling up memory problem, in any version of macOS. Running 14.3.1 now.

Oct 19, 2023 1:15 PM in response to lloyd_dawson

Apple Mail App on Sonoma has a memory leak on both my MacBook Air 2023 and Studio 2022. Consumes >32 GB over 10's of minutes, continues growing until system memory is full and receive system warning. Have to attempt to quit app, or force quit, to recover. Happens after restart.


System and App software installations are rather vanilla - no secondary extensions/mods. Apps are all approved for Sonoma.


May 8, 2024 5:17 AM in response to dialabrain

Consider yourself lucky, I provide helpdesk tech support to a school district with 300+ macOS devices. I actually did not start seeing this issue until 14.0. The initial "fix" was upgrade to 14.1. after it still happened to random users and the common culprit appeared to be Print Center, the next "fix" was to "Reset the print system". This behavior has continued though the latest update of 14.4.1 on Mac Mini's (M1, 2020) and MacBook Air's (M1, 2020). Not seen on any M2 or M3 devices yet.


Unfortunately I can NOT narrow it down to any of the following:

  • External monitor users only.
  • Chrome users with many tabs.
  • Print Center may or may not be in the list of apps.


I have seen users with lots of tabs with no issues and users with minimal tabs with issues. When they see the error no app is showing an excessive amount of memory in use, but the Force Quit dialog window reappears before any app can be quit. With the Force Quit dialog window open there is no way to launch activity monitor to troubleshoot. The only resolution is a hard restart. Which of course resolves the immediate issue


Nov 12, 2023 4:15 PM in response to Owl-53

I have had memory leaks on Apple Mail since upgrading to Ventura. The same continues with Sonoma. If I open Apple mail, then within five minutes I get the memory overload warning and have to force quit Apple Mail. I have spent MANY hours online and on the phone with "senior" Apple support and no solution. They confirmed TANGIBLE, REPRODUCIBLE, AND REPEATABLE evidence of the problem. But no solution.


One of the senior Apple techs just suggested using the Gmail web app. Wow.

Oct 17, 2023 1:47 PM in response to lloyd_dawson

It is one thing to say there is a Memory Leak in Sonoma 14.0


It is an another thing to provide Tangible, Reproducible and Repeatable evidence to support this assertion.


Would suggest making a Bug Report to Apple as there may or may not be time before the 14.1 Beta is finalized


FYI - on 3 different Apple M1 / M2 Personal Computers - no Memory Leaks I can find, so far



Nov 17, 2023 3:19 AM in response to lloyd_dawson

I have a new MB M3 w/ 36GB of memory, running 14.1.1 and I'm getting the "out of memory force close" pop-up. Stating I only have 5GB remaining, after force closing everything reported I only have 7GB remaining. I had a similar issue on my MB M2 w/ 16GB prior to trading it in. I've also experienced it on my Air M2. The common denominator is Sonoma.

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.

MacBook Air memory leaks following the Sonoma Update

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