Figure: Diagnostic workflow: Heap/browser resources → Reduce resident assets → Measure target devices
Figure: Diagnostic workflow: Heap/browser resources → Reduce resident assets → Measure target devices

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

  1. Inspect browser logs and device memory; separate startup peaks from gradual growth.
    Release / Dispose
    Release / Dispose
  2. Check version-specific initial/maximum memory and growth settings. Do not blindly add old Emscripten flags.
    Release / Dispose
    Release / Dispose
  3. Reduce textures, audio, concurrent loads, and large temporary strings; release handles and GPU resources.
    Release / Dispose
    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

  1. Separate Wasm heap, decompression and GPU resources.
    Release / Dispose
    Release / Dispose
  2. Reduce large assets/concurrent loading and compare peak versus residency.
    Release / Dispose
    Release / Dispose
  3. After growth-setting changes retest startup and repeated operations.
    Release / Dispose
    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.

Related explanations

References