Search Issue Tracker
Active
Votes
4
Found in
2019.4
2019.4.30f1
2020.3
2021.2
2022.1
Issue ID
1380320
Regression
No
GUIUtility.BeginGUI() causes memory allocations every time when a GameObject with OnGUI() is instantiated
How to reproduce:
1. Open attached project "case_1380320.zip"
2. Enter Scene "SampleScene" (Assets > Scenes)
3. Make sure the Profiler window is docked in the Editor (View > Analysis > Profiler)
4. Enter "GUIUtility.BeginGUI()" into a search bar inside of the Profiler window
5. Enter Play Mode
6. Select any frame in the Profiler window
7. In the Profiler window's Overview area observe the value in "GUIUtility.BeginGUI()", "GC Alloc" column
8. In the Hierarchy window copy and paste GameObject "GameObject"
9. In the Profiler window clear the frames by pressing the "Clear" button and unpause Play Mode
10. Select any Frame in the Profiler
11. In the Profiler window's Overview area observe "GUIUtility.BeginGUI()" GC Alloc column
Expected result: The value under the "GC Alloc" does not increase
Actual result: The value under the "GC Alloc" column increases by 0.3-0.4 KB
Reproducible with: 2019.4.0f1, 2019.4.33f1, 2020.3.23f1, 2021.2.4f1, 2022.1.0a16
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Add comment