Search Issue Tracker
Fixed in 1.3.4
Votes
0
Found in [Package]
1.1.0
Issue ID
1214752
Regression
No
Memory is not cleared after loading an empty Scene with SceneLoadMode.Single, calling GC.Collect and Resources.UnloadUnusedAsset
How to reproduce:
1. Open attached project "leakTest2019.3.0f3.zip"
2. Build and Run the project
3. In Editor, open Memory Profiler window
4. Take a snapshot and observe it
5. In Build, press "Space" (this will unload the resources and load an empty scene)
6. Repeat steps 3 and 4
Expected result: the snapshot memory size is different (step 6 should have less memory allocated)
Actual result: the snapshot memory size is the same
Reproducible with: 2019.1.9f1 (memory profiler prev.9 - 0.1.0), 2019.2.20f1, 2019.3.0f6, 2020.1.0a21
Not reproducible with: 2018.4.16f1 (memory profiler prev.9 - 0.1.0)
Could not test with: 2017.4 (package manager is not implemented, hard to check specific memory allocations), 2019.1.0a1-2019.1.8f1 a lot of different issues (errors in console window, Editor freezing after opening SampleScene, Memory Profiler stuck on creating a capture window after Capture Player is pressed)
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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- Crash with “Fatal Error! The file ‘MemoryStream’ is corrupted!” when adding a large number in Font Character Rects Size field
Resolution Note (fix version 1.3.4):
Playable graphs will release their assets at the end of the frame, in order to safely terminate the graph.
Then GC needs to run in order for the refcount on the Assets to go to zero.
Then UnloadUnusedAssets needs to run in order to unload the assets.
All of this needs to be done in a script outside of the scene being unloaded, because coroutines will stop running at the end of the frame, because the object has been unloaded.