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

Add an example demonstrating how to load your assets sequentially to reduce memory usage on web platforms #12653

Open
alice-i-cecile opened this issue Mar 22, 2024 · 1 comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Examples An addition or correction to our examples C-Performance A change motivated by improving speed, memory usage or compile times O-Web Specific to web (WASM) builds

Comments

@alice-i-cecile
Copy link
Member

What problem does this solve or what need does it fill?

On WASM, memory cannot be reclaimed / freed. As a result, loading all of your assets up front in a loading-screen pattern will balloon your memory usage and it will never go back down. See #12057 for more context.

What solution would you like?

Add an example demonstrating how to load assets one at a time, and then moving them onto the GPU using RenderAssetUsage once loaded.

Explain why this is useful for web.

What alternative(s) have you considered?

We could make this the default behavior on wasm.

Additional context

This came up when helping a commercial user debug performance issues on iOS.

@alice-i-cecile alice-i-cecile added C-Examples An addition or correction to our examples A-Assets Load files from disk to use for things like images, models, and sounds C-Performance A change motivated by improving speed, memory usage or compile times O-Web Specific to web (WASM) builds labels Mar 22, 2024
@alice-i-cecile
Copy link
Member Author

Upstream issue discussing WASM's memory limitations: WebAssembly/design#1397

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-Examples An addition or correction to our examples C-Performance A change motivated by improving speed, memory usage or compile times O-Web Specific to web (WASM) builds
Projects
None yet
Development

No branches or pull requests

1 participant