Search Issue Tracker
Won't Fix
Votes
0
Found in
2020.3.47f1
2021.3.22f1
2022.2.14f1
2023.1.0b12
2023.2.0a10
Issue ID
UUM-34319
Regression
No
Memory Leak caused by multithreading in a development build with script debugging enabled when the Player is opened
Reproduction steps:
1. Open the attached project “MemoryLeak”
2. Open File > Build Settings
3. Ensure that you are building the SampleScene and that Development Build and Script Debugging are enabled
4. Select Build And Run
5. Open the Task Manager, go to Details and enable the Column Handles
6. Observe the amount of Handles of ThreadHandleLeak.exe
Expected result: Amount of Handles do not increase
Actual result: Amount of handles constantly increasing
Reproducible with: 2020.3.47f1 2021.3.22f1, 2022.2.14f1, 2023.1.0b12, 2023.2.0a10
Reproducible on: Windows 10, macOS 13.3
Notes:
Changing "threadCountPerFrame" in MainSceneObject.cs to a higher value before building makes the Handles created increase faster.
A build without Script Debugging enabled will work fine, and regularly collect handles. To make this more visible, one can increase the number of threads per frame, and manually run the Garbage Collector during a regular build.
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
- Crash on when D3D12RenderPass::SetupDeviceResources when opening FBX animation preview
- Serialization errors are thrown when "com.unity.render-pipelines.core" is added as a custom package and Graphics window is opened
- Character Joints unexpectedly rotate when a ragdoll is created using the Ragdoll Wizard
- Crash on GfxDeviceD3D11Base::DrawBuffersBatchMode when rendering the Scene view
- The shared EditorBuildSettings.asset file of symlinked projects is not updated when changing the order of the Scenes in Build Settings in one of the projects
Resolution Note:
The thread handle and memory leaks are currently expected based on the debugger implementation. We don't expect they will be a problem in practice in real projects, but please respond here if they are and we can consider changing the implementation.