Skip to content

WebAssembly maximum memory 2GB causes Out of Memory error on iOS Safari 16.2 #70621

Open
@TyounanMOTI

Description

@TyounanMOTI

Godot version

4.0.dev (f382a2b)

System information

iOS 16.2 Safari, iPhone 13 Pro

Issue description

When exporting for Web and running on iOS 16.2 Safari, out of memory error occurs at WebAssembly.Memory initialization.
This error comes because maximum argument is 2048MB which is quite bigger for iOS.
When I changed WASM_MEM_MAX to 256MB for example at platform/web/detect.py: 197, the error disappeared.

    env.Append(LINKFLAGS=["-s", "WASM_MEM_MAX=256MB"])

Steps to reproduce

  1. Build Godot Web export with option module_raycast_enabled=no to disable WebAssembly SIMD usage which seems to be not yet supported on iOS Safari 16.2.
  2. Export minimal reproduction project to Web.
  3. Out of memory error log will be found on JavaScript console (reproduced).
  4. Change WASM_MEM_MAX to 256MB and rebuild Web export.
  5. Re-export minimal reproduction project.
  6. Rotating unlit white cube is correctly rendered (reproduced).

Minimal reproduction project

simple_rotating_white_cube.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions