Hi!
We are considering shifting from asm.js to Web Assembly (wasm) (Unity 2018.2.14f1)
What we are concerned about is how wasm deals with memory (to avoid running out of memory errors). We have gone through most wasm unity blogs and posts, however a few things are still unclear:
1- In asm.js, Unity’s blogs stated that the content required a contiguous block of memory (the heap we request in Player settings). Does wasm also use contiguous blocks?
2- Unity blogs state that in wasm, the heap size keeps on increasing as it is needed. By what factor does it increase each time, 2x?
3- Unity blogs state that in wasm, the heap size keeps on increasing as it is needed. Is it possible to set a maximum limit till which we want the heap to grow automatically? Does the following emscripten argument do that:
PlayerSettings.WebGL.emscriptenArgs = "-s WASM_MEM_MAX=512MB";
4- Unity blogs state that in wasm, the heap size keeps on increasing as it is needed. Is it possible to set a starting heap size from which the heap size can keep on growing?
Using asm.js, we needed 435 mb total heap memory for our content to run. Without any min and max limits, wasm increases the total heap memory to 536 mb where 170 mb is free (and hence waste). Any suggestions for this?
Would be very grateful if you can answer as many of the above as possible.
Thanks.