Reproduction:
1. Open the “BugReport_memoryleak.zip” project
2. Open the “SampleScene” scene (Project window → Assets → Scenes)
3. Open the Profiler
4. Enter Play mode
5. Wait 1-2 minutes
6. In the Profiler, observe Total Committed Memory and Untracked Memory
7. Exit Play mode
8. In the Profiler, observe Total Committed Memory and Untracked Memory
9. Enter Play mode again
10. Wait 1-2 minutes
11. In the Profiler, observe Total Committed Memory and Untracked Memory
Expected result: Memory is allocated, but freed after some time
Actual result: Memory is allocated but not freed completely. Eventually, memory builds up
Reproducible with: 6000.0.60f1 (f02d6f9f9009), 6000.2.8f1(c9992ac36c34), 6000.3.0b7, 6000.4.0a3
Could not test with: 2023.1.0a1 (The project works, but to enter Play mode, you have to rebuild the project which seems to fix the issue)
Note:
- A video capture of the issue “memoryleakBug.mp4” is attached.
- The issue can be seen with Radeon cards, the memory goes up by 100MB at a time, while on NVidia it goes up by 2MB at a time.