Im loading a few pictures streamed from a remote server, then putting the pictures onto a gameobject. Soon after that those pictures get replaced with other pictures that are streamed in and placed on the same gameobjects as textures.
After doing this a few times firefox slaps me with out of memory error.
Are the pictures that are streamed in stored somewhere causing the out of memory? I dont need them stored because those pics are replaced by other pics, so storing them in a cache memory is not wanted.
Anybody have any idea why this is happening, or how i can disable some unknown built in caching if that’s whats happening? Is it because i put them as textures on gameObjects that the memory is gone so quickly? Are all textures stored by unity even if they are not used anymore and unreferenced?
My memory is set to 512, it was 256 originally and i got the memory error, so i upped it to 512, but it just takes a bit longer to get the same error.
You are most likely running out of the heap memory (and not out of the memory available for the browser), pay attention to the error message in the browser console to make sure.
Running out of the heap memory is not related specifically to WebGL and should be reproducible on other platforms given the same memory limit (512MB in your case). Your issue is very much similar to the one described in another thread, where developer did not explicitly destroy the previous texture while applying the new one (created assets should be explicitly destroyed, you may also use Resources.UnloadUnusedAssets() for this). Check out the following reply: http://forum.unity3d.com/threads/how-do-i-let-the-user-load-an-image-from-their-harddrive-into-a-webgl-app.380985/#post-2649561