Search Issue Tracker
By Design
Votes
0
Found in
2018.1.0b7
Issue ID
1004043
Regression
No
[WebGL] Garbage collection doesn't work on scene change
How to reproduce:
1. Download attached project file
2. Change Platform to WebGL
3. Build "Scene 1" and "Scene 2"
4. Click "Load Scene 2" and notice the "Out of memory" error
Actual result: According to this blog post ( https://blogs.unity3d.com/2016/12/05/unity-webgl-memory-the-unity-heap/ ) the only time GC.Collect is performed in WebGL is on Scene Load, but in practice, it doesn't seem to be the case.
In the attached project I used an example "Prealloc" function from that post and from what I can see loading new scene doesn't seem to free the memory.
Reproduced with: 2017.3.1p3, 2018.1.0b8, 2018.2.0a1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Resolution Note:
Garbage collection works as expected, however, memory manager can not allocate a continuous block of memory in the same place, because some part of the freed continuous block is already in use. Not reproducible in 2018.2.0f2 and newer.