Cause and mechanism
WebGL Out of Memory means the browser cannot provide memory the application needs. Separate the Wasm heap used by game code, decompressed assets, GPU resources, and browser limits. Memory growth settings depend on the Unity version, so do not rely only on older instructions to raise a fixed WebGL Memory Size.
Check and correct the setup
- Inspect browser logs and device memory; separate startup peaks from gradual growth.
Release / Dispose - Check version-specific initial/maximum memory and growth settings. Do not blindly add old Emscripten flags.
Release / Dispose - Reduce textures, audio, concurrent loads, and large temporary strings; release handles and GPU resources.
Release / Dispose
Limits and verification
A higher limit does not guarantee allocation succeeds in the browser. Test repeated transitions in target browsers, including mobile.
A focused diagnostic setup
Distinguish startup failure from growth across scene cycles. Fix browser/device conditions and preserve full console errors.
Test in this order
- Separate Wasm heap, decompression and GPU resources.
Release / Dispose - Reduce large assets/concurrent loading and compare peak versus residency.
Release / Dispose - After growth-setting changes retest startup and repeated operations.
Release / Dispose
Interpret the result
Recurring growth suggests lifetime/references; startup peaks suggest expansion/concurrency. Higher limits do not guarantee allocation or solve GPU exhaustion.