WebGl RAM requirements
I am trying to publish a build of my game as WebGL but I have run into a problem. The RAM needed to run the game spikes at around 1.8 - 1.9GB in Chrome and 1.3 - 1.5GB in Firefox. After the initial loading is done, in Firefox the RAM usage goes down to about 800MB which is acceptable, but in chrome it stays at 1GB+.
According to the Editor Log the biggest assets in my project are the textures at around 100-150MB, and the rest is negligible. As far as scripts go, I am only using one FPS character and the lighting is Baked. So what is causing the huge jump in RAM usage during loading? And is there any way to mitigate this?
Answer by DiegoSLTS · Aug 28, 2016 at 05:03 PM
The best way to find what's causing that is using the profiler.
Here you have some instructions to profile a WebGL game: https://docs.unity3d.com/Manual/Profiler.html Here's some info on the Memory profiler: https://docs.unity3d.com/Manual/ProfilerMemory.html
Tried it, the profiler says that it's only using about 250 $$anonymous$$B... But in in the Task $$anonymous$$anager I can clearly see that it's much more than that.
I did some research and what you describe sounds like a bug on Chrome. According to this forum post, getting a spike in RA$$anonymous$$ usage on the browser is expected when initializing WebGL and, like you see in Firefox, it goes down again after that.
According to this bug report, Chrome has some RA$$anonymous$$ problems with WebGL.
It looks like there's not much you can do in your game to prevent that =/...
O$$anonymous$$. Thanks for the info.