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

WebGL

-

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

  1. 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.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.