Search Issue Tracker
Fixed in 2021.2.X
Additional memory allocated when removing WorkRequest in UnitySynchronizationContext.cs
How to reproduce:
1. Open the included project "AsyncTest_Repro.zip"
2. In Build Settings enable: Development Build, Autoconnect Profiler and Deep Profiling Support
3. Build and run the project
4. Click the button "Start Await_VoidReturn" several times
5. In the profiler observe how UnitySynchronizationContext.Exec() -> List'1.Remove() allocates memory (video attached "HowToReproduce.mp4")
Actual result: List'1.Remove() calls List'1.IndexOf() which allocates additional memory
Expected result: List'1.RemoveAt(0) could be used instead, as it does not allocate additional memory
Reproducible with: 2019.4.28f1, 2020.1.6f1, 2020.2.0b8, 2021.1.0a1
Not reproducible with: 2018.4.28f1 (This stream does not have m_CurrentFrameWork.Remove(work) in UnitySynchronizationContext.cs implemented, see case 1213602)
- Link to affected code: https://github.com/Unity-Technologies/UnityCsReference/blob/master/Runtime/Export/Scripting/UnitySynchronizationContext.cs
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Mouse inputs cannot be inputted when searching the Shortcuts Menu by type "Shortcut"
- "Debug Assertion Failed!" error when launching Windows Dedicated Server Player with Script Debugging enabled
- [Cinematic Studio][3D HDRP] Shader warnings thrown in the Console window when creating a new project with Cinematic Studio template
- Autoplay is triggered on Audio Assets when changing Asset Bundle tags
- Inspector Asset Bundle section has no indication for Variants, AssetBundle is written without a space, and Variant dropdown menu is available without setting the Asset Bundle first