Unity Issue Tracker - Allocated graphics memory does not get released when the Editor is out of focus while using D3D12 graphics API
Fixed
UUM-86354
Allocated graphics memory does not get released when the Editor is out of focus while using D3D12 graphics API
Unity: DirectX12
Fixed
6.2.X
6.1.X
6.0.X
2022.3.X
Fix the memory of released textures accumulating, when the editor is out of focus on DX12.
Fix the memory of released textures accumulating, when the editor is out of focus on DX12.
How to reproduce:
1. Open the attached “IN-87923” project
2. Open Task Manager
3. In the menu bar of the Unity Editor, select “Test → EditorUpdate → Run Multiple (Without Flush)”
4. Unfocus the Editor by clicking anywhere inside the Task Manager window
5. Observe the “Memory” tab in the Task Manager
Expected result: The Editor’s memory usage does not change by a significant amount
Actual result: The Editor’s memory usage increases by several gigabytes over time
Reproducible in: 2022.3.52f1, 6000.0.26f1, 6000.1.0a3
Not reproducible in: 2021.3.45f1
Reproducible on: Windows 10, Windows 11
Not reproducible on: No other environments tested
Notes:
Not reproducible using D3D11 or Vulkan graphics APIs
Invoking GL.Flush() helps alleviate some of the memory buildup, but it still continues to build up over time, albeit at a slower pace (Test → EditorUpdate → Run Multiple (With Flush))
Focusing the Unity Editor during method execution releases the allocated memory
Could not find the regression point due to compilation errors when downgrading the project. The earliest tested version is 2022.2.5f1, where the issue reproduces. Downgrading to 2022.2.0f1 introduces compilation errors
Prioritise and Follow this issue
Have a workaround or additional info about this issue?