WebGL Memory leak

Hi. I built the project using Unity 5.0.1.p2. Then i load it in Chrome and watched amount of the used RAM memory through a Windows->TaskManager->Processes.
When the project was completely loaded it used 800 MB (That is already strange, the project very small) after loading the second scene, amount of the used memory jumped up to 1-1.1 GB. And when I returned on the first scene, process still used 1-1.1GB. If I correctly understand - memory wasn’t cleared from the previous scene. I didn’t use “DontDestroyOnLoad” in the second scene.

Main Question:
Why memory wasn’t cleared and how to clear it?
Second question:
Why so small project right after start already uses 800 megabytes?
Third question:
How the scene (which AssetBundle weight is 3MB) with few GUIWindows can occupy 200-300 MB?

In FireFox situation is even worse, memory isn’t cleared even after reload the page. And then process takes even more memory. It is necessary to reboot a browser or wait about 5-10 minutes, then the browser will release memory.

P.S.
I can’t use the profiler because it is broken on Windows in Unity 5.0. And I can’t use Unity 5.1 because of an Error which I described here.

Up this a bit, i got the exact same problem. Did you find a solution ?

Have you tried an empty scene to compare the default memory footprint of Unity WebGL in your browser?

in fact my first scene is almost empty, and the chrome task manager show 850mo…

That bug has already been fixed a long time ago. Could you try again with the latest patch ?

Hi everyone,

I have this exact problem with the latest patch on 5.1 ! I tried to build an empty project, does not work either …

In fact, the web player load the project (the scrollbar is full), but the project is never launched and the memory keep increasing and make my browser crash.

Any ideas ?

Thanks

1 Like

I’m having exactly the same issue, using Unity5 free (updated to the latest version today) would love to know if anyone has a solution as a client is asking for a WebGL build soonest. I’m still searching for a solution, so I’ll post a reply if/when I find one.

I’d like to investigate this. Can anyone please submit a bug report with a small repro project ?

It seems this happens with my project too, you can play it here Bullet Force by nxtboyIII

I have same issue. But Windows Chrome only. Mac Chrome is no problem.
Memory Spike occurs just been left for several minutes WebGL App on Windows Chrome.
Immediately after Chrome to crash .
This problem has occurred from Unity5.2.1f.

I am not sure this is the same problem initially reported in this thread, however, there is a known memory leak in Chrome which Google is working on right now. We’ll post more info in the forum as soon as we know more.

It seems the problem is better if I go into incognito mode, maybe because caching is disabled? There must be some issue with WebGL caching and memory

Hello! Sorry to bump such an old thread but I believe I’m experiencing this issue today on Windows 10 Chrome 32-bit. If you leave the WebGL application running for about 2 mins it freezes. Is that the memory leak issue you’re referring to Marco?

For reference - my recent post:

The issue I was referring to was fixed long time ago, if you are using 5.3 then you should be fine.

Thanks Marco! Still experiencing my problem, but hopefully have a couple leads.

Hi Marco, I’m still having issues, and was curious if this: https://bugs.chromium.org/p/chromium/issues/detail?id=533648

is the bug you were referring to? Because it looks like it’s been reopened in February by the Chromium folks.

Also, I don’t mind taking this discussion over to the thread I mentioned before so we’re staying on topic:

http://forum.unity3d.com/threads/webgl-build-freeze-after-2-minutes-on-windows-10.393470/

Yes, that’s the issue, which we implemented a workaround for. If you are still experiencing a memory leak with 5.3.x, then it might be a different problem and it might be a good idea to send us a bug report with a project so we can investigate.

Thanks Marco, bug report submitting now. Really appreciate you guys!