-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MacBook Pro quickly maxes out its memory when running a project on Compatibility rendering method with ANGLE #85619
Comments
I’m seeing something similar (also with 4.2.stable). Running my game and watching its memory usage in Activity Monitor (MacBook Pro M1, macOS 12.7), memory keeps climbing. It starts around 768 Mb. The Godot editor remains around 1.61 GB but the game is now up to 12 GB and has the spinning pizza. I switched from Compatibility renderer to Mobile and memory for my game remains under 730 MB. (The editor takes a little more than under Compatibility but is stable in both configurations.) |
Thank you for posting this - switched from Compatibility to Forward+ and now my game is working again. Before it was freezing after 75-85 seconds, and only if I had a UI control node visible, and it was doing my head in. Could not reproduce on Windows or Linux, only Mac. |
I believe Compatibility uses OpenGL, and macOS has poor support for OpenGL. Mobile and Forward+ use Vulkan (by way of MoltenVK a Metal-to-Vulkan translationl layer iirc), which would explain the discrepancy. Windows and Linux generally have better support for OpenGL (and also Vulkan fwiw). |
Can you reproduce this in 4.1.3? If not, please check 4.2 dev/beta/RC builds for this issue as well to determine when the regression started: https://downloads.tuxfamily.org/godotengine/4.2/
ANGLE is used by default in Godot 4.2 on macOS, so that its own Metal backend is used instead of Apple's own OpenGL-over-Metal layer. It's also used on Windows on old GPUs by default to circumvent issues with their buggy OpenGL drivers. You can control whether ANGLE is used in the Project Settings, or using the |
May have spoken too soon — I left my game running for several hours and it hit around 14 GB of memory and was no longer responding to events (beachball cursor). I’ll have to try to repeat this but it was at least an hour (with the Mobile renderer). So far I haven’t had luck attaching the Leaks instrument. |
Going back to 4.1.3, Compatibility renderer might have the slow leak (pretty sure it’s not my code) but not the quick one. |
Disabling ANGLE ( |
This comment was marked as outdated.
This comment was marked as outdated.
To build with ANGLE you need to download static libs from https://github.com/godotengine/godot-angle-static and build with |
Still reproducible in current Something weird is, when the window is hidden by other application, it will stop increasing its memory usage; if it is visible, it starts consuming memory again. |
Actually, I was running it with the wrong binary without ANGLE, so it was a native GL result. I can confirm a leak with ANGLE:
|
This is reproduceable. If I keep the window focused, it’ll last about 75 seconds before freezing. When I have another window focused, it’ll chug on merrily behind. |
This comment was marked as outdated.
This comment was marked as outdated.
This is probably a side effect of App Nap feature in MacOS and not caused by godot itself. |
No, it's still no leaking, so no idea. |
Godot version
4.2.stable (.NET version)
System information
macOS Ventura 13.6.1, MacBook 2017 Intel Core i5, Iris Plus 650, 16 GB ram
Issue description
My friend was testing my Godot project (which has the Compatibility rendering method configured) and he said that his MacBook quickly ran out of memory. The game was allocating 15 GB of RAM after a minute or two. More interestingly, the same happened with the 2D platformer demo project from https://github.com/godotengine/godot-demo-projects, when running in Compatibility mode. My Windows machine doesn't suffer from this at all.
Fortunately, we figured out that switching to Forward+ mode fixed the issue. The downside is that I have now lost a potential audience of devices that need Compatibility rendering.
Here's what he saw in the profiler:
By the way, when my friend closes the editor, he gets the following which might be related (I have no idea but who knows):
Steps to reproduce
Run the 2D platformer demo project from https://github.com/godotengine/godot-demo-projects and set it to the Compatibility rendering method (or possibly any other game that can run in this mode) on a MacBook (maybe only one that matches the provided system specs or maybe any Mac, I don't know).
Minimal reproduction project
2D/platformer demo from https://github.com/godotengine/godot-demo-projects in Compatibility rendering mode
The text was updated successfully, but these errors were encountered: