I am trying to set WebGL memory to 32MB so that it starts small, and will be expanded dynamically using WASM according to this page:
Is it possible to do this using Module parameters passed into UnityLoader.js? If so - is there a list of the Module parameters somewhere?
I currently set:
TOTAL_MEMORY
wasmCodeUrl
wasmFrameworkUrl
But if I change TOTAL_MEMORY to anything less than 256MB, I get a JS error:
“Uncaught (in promise) LinkError: WebAssembly Instantiation: memory import 0 is smaller than initial 4096, got 512”
Interesting, same error ios gives when it runs out of memory for its JIT portion of their compiler (supposedly). At any rate that’s probably unrelated to your problem, perhaps you are trying to change the memory size after you made your buid (wasm is not like asm.js, memory size is baked into the build)? I can confirm though setting wasm to start with 32MB and allowing it to dynmaically expand works (this is what we do).
1 Like
@kognito1 thanks for the reply. So in order to set the starting memory to 32MB, you just do that through the Player Settings?
Correct! Make sure you only target wasm (not both asm.js and wasm). That should enable the abilty to dynamically increase in size.
1 Like