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

iOS WASM out of memory error - asset loading #12921

Open
v-kat opened this issue Apr 10, 2024 · 5 comments
Open

iOS WASM out of memory error - asset loading #12921

v-kat opened this issue Apr 10, 2024 · 5 comments
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior O-iOS Specific to the iOS mobile operating system O-Web Specific to web (WASM) builds

Comments

@v-kat
Copy link

v-kat commented Apr 10, 2024

Bevy version

0.13.1

AdapterInfo { name: "Apple GPU", vendor: 4203, device: 0, device_type: Other, driver: "", driver_info: "", backend: Gl }

iOS 17.2

Loading 10 larger images quickly with asset_server.load(format!("tester{}.webp", x)); on iOS web causes:
317829886-81be22d5-7943-4ea4-a5b8-b9901db5d7a3

https://github.com/v-kat/bevy_bad_render_bug_repo has a reproduction

Also see #12678 (reply in thread)

@v-kat v-kat added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Apr 10, 2024
@SolarLiner SolarLiner added A-Assets Load files from disk to use for things like images, models, and sounds O-Web Specific to web (WASM) builds O-iOS Specific to the iOS mobile operating system and removed S-Needs-Triage This issue needs to be labelled labels Apr 11, 2024
@SolarLiner
Copy link
Contributor

Tagging as both iOS and Web, but something tells me this is reproducible on all OSes, as it looks like a problem with WASM memory management.

@v-kat v-kat changed the title iOS out of memory error - asset loading iOS WASM out of memory error - asset loading Apr 12, 2024
@alice-i-cecile
Copy link
Member

A commercial app (Cult) encountered this. You need to be careful to load your assets sequentially unfortunately due to limitations in WASM's memory management.

@alice-i-cecile
Copy link
Member

alice-i-cecile commented May 28, 2024

More discussion about workarounds here. #12653 discusses adding an example for this. WebAssembly/design#1397 discusses this problem more broadly.

@v-kat
Copy link
Author

v-kat commented May 28, 2024

A commercial app (Cult) encountered this. You need to be careful to load your assets sequentially unfortunately due to limitations in WASM's memory management.

Can this be made the default behavior on WASM builds (loading assets sequentially)? I don't see how this would ever be desirable otherwise. It seems like there's maybe something wrong with the asset loading on web wasm otherwise e.g. memory leak or other parallelism issue. My example explicitly involves low amounts of memory and loading and still triggers the problem.

@alice-i-cecile
Copy link
Member

Yep, I think that's a good next step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior O-iOS Specific to the iOS mobile operating system O-Web Specific to web (WASM) builds
Projects
None yet
Development

No branches or pull requests

3 participants