Skip to content
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

MacOS Intel memory leak #14054

Closed
knutsoned opened this issue Jun 27, 2024 · 3 comments
Closed

MacOS Intel memory leak #14054

knutsoned opened this issue Jun 27, 2024 · 3 comments
Labels
A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior O-MacOS Specific to the MacOS (Apple) desktop operating system S-Needs-Investigation This issue requires detective work to figure out what's going wrong

Comments

@knutsoned
Copy link

knutsoned commented Jun 27, 2024

Bevy version

0.14.0-rc.3

Relevant system information

SystemInfo { os: "MacOS 13.6.7 ", kernel: "22.6.0", cpu: "Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz", core_count: "6", memory: "40.0 GiB" }
AdapterInfo { name: "AMD Radeon Pro 570X", vendor: 0, device: 0, device_type: DiscreteGpu, driver: "", driver_info: "", backend: Metal }

What you did

git clone https://github.com/bevyengine/bevy.git
cd bevy
git checkout v0.14.0-rc.3
cargo run --example 3d_scene

What went wrong

The example runs as expected. Use the following command:

ps au | awk 'NR>1 {$5=int($5/1024)"M";}{ print;}' | grep 3d_scene | grep -v grep

The vsz field grows at a rate of up to 10MB/second. I would expect the memory allocation to not change very much since Bevy is just rendering a simple scene.

Additional information

This issue was first noticed using the server example from https://github.com/pcwalton/bevy/tree/brp which is the equivalent to running the 3d_scene example plus the new RemotePlugin server. The issue also occurred in an example that loaded the same scene but did not run the server. 3d_scene was selected for the reproduction because it is closest to the actual examples that created a noticeable issue. The indication there was a problem came from a macOS popup that indicated that both client and server examples had grown to 160GB each and the OS was out of RAM completely.

This just appeared in the terminal that spawned the 3d_scene example:

2024-06-27 13:15:36.779 3d_scene[79794:2365453] IMKClient Stall detected, please Report your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_bundleIdentifierWithReply:) block performed very slowly (2.25 secs).

@knutsoned knutsoned added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jun 27, 2024
@alice-i-cecile alice-i-cecile added S-Needs-Investigation This issue requires detective work to figure out what's going wrong and removed S-Needs-Triage This issue needs to be labelled labels Jun 27, 2024
@alice-i-cecile alice-i-cecile added this to the 0.14 milestone Jun 27, 2024
@mockersf
Copy link
Member

I can't reproduce on macOS with an m1 arm processor, it's likely a macOS Intel only issue

@alice-i-cecile alice-i-cecile removed this from the 0.14 milestone Jun 27, 2024
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in O-MacOS Specific to the MacOS (Apple) desktop operating system labels Jun 27, 2024
@alice-i-cecile
Copy link
Member

I would expect either the winit or wgpu upgrade, for those trying to bisect.

@alice-i-cecile alice-i-cecile changed the title Possible memory leak MacOS Intel memory leak Jun 27, 2024
@mockersf
Copy link
Member

duplicate of #9035

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior O-MacOS Specific to the MacOS (Apple) desktop operating system S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

No branches or pull requests

3 participants