Search Issue Tracker
Fixed
Fixed in 2021.3.39f1, 2022.3.31f1, 6000.0.3f1
Votes
0
Found in
2021.3.32f1
2022.3.13f1
2023.2.0f1
2023.3.0a14
6000.0.0b11
Issue ID
UUM-56327
Regression
No
Memory leak when using OnGUI
Steps to reproduce:
1. Open the attached user's project "U2020_3_48-OnGuiBehaviorLeak.zip"
2. Open the "SampleScene.unity" Scene
3. Enter Play Mode
4. Open Profiler and enable Memory Profiler Module
5. Observe the memory increase
Expected results: no memory leak when using OnGUI
Actual results: Memory leak when using OnGUI (See attached "Snapshot Comparison.png")
Reproducible with: 2021.3.32f1, 2022.3.13f1, 2023.2.0f1, 2023.3.0a14
Reproducible on: Windows 10
Not reproducible on: No other environment tested
Notes:
-A MonoBehavior with "void OnGUI()" in it is all that is needed. A GameObject is dynamically created by calling a new GameObject and the OnGUI component is added then the GameObject is destroyed, thus memory increases.
-Issue is reproducible in Player
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Add comment