allows the WebGL player to dynamically change the size of the memory buffer.
For me (and probably many others out there), there is not much of a slowdown caused by using this flag, and stability is more important to me than speed.
So, FYI, using this flag will disable asm.js optimizations. This supposedly makes your player much slower. I have not seen much slowness, but your results may vary.
I tested it on Chrome. I set the memory to 256MB, although you could use any number that doesn’t exceed the browser’s capacity.
That sounds… devastating. Our game codebase is so large, that it is unstable in browsers unless optimize is on - we had to give up ever making debug builds.
It will disable some optimizations in chrome. Not all, I think. Also it doesn’t disable optimizations in firefox.
I haven’t seen any negative effects from using this, however it might be worth noting that if you can’t allocate the larger memory size initially, odds are you can’t grow to that size, since that requires even more memory be available when you try to grow.
We have been considering using this flag, but so far decided not to to because:
As written here, doing so would disable some optimizations in Chrome. We have yet to do some real benchmarking on this impact of this.
I’d expect that using this might actually make memory issues worth. If you have reached a point where the Unity Heap is to small to fit all the required memory, and it needs to grow, then the browser would have to allocate a bigger heap, and copy everything over from the old heap, and then deallocate the old heap. By doing so, it needs memory for both the new and the old heap at the same time (until it finished the copy), thus requiring more total memory. So the memory usage would be higher then when using a predetermined fixed memory size.
It would be more convenient for the developer, though.