'Heap memory increasing in each page load in chrome

I am getting aw snap or sometimes not enough memory problem when I reload my WebGL page. I have a WebGL project which is empty (just a camera + light), developed in unity3d. I am reloading it, and profile its memory. enter image description here

As you can see that its load 1.2MB in the first load than 1281 MB in second then 1574 then 2160 and then get crash. I am amazed that why it is happening?

I searched and found that



Solution 1:[1]

the problem

the webgl build runs fine on every desktop browser and firefox mobile, but crashes after 3 seconds when using chrome mobile or safari mobile with the "aw, snap" page.

the problem was the amount of RAM that the project was using for loading assets. i found that the main problem was loading the audio system.

when the game started the RAM usage quickly escalated from 300 MB to 1,3GB.

how i fixed

i had a background music 20 minutes long, i cut that to 5 minutes. click the music, then click override for webgl set the load type to Streaming set the quality to 1

with this workaround the RAM usage floats around 600 MB, this allows the build to run on mobile.

this is an example

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 TheTimeSte