Search Issue Tracker
Duplicate
Votes
0
Found in
5.3.3p2
Issue ID
778662
Regression
No
Unnecessary GC pressure in editor when querying for a component that does not exist
Using this.gameObject.GetComponent<>(); uses much more memory if you are searching for the component that does not exist on that specific game object in the editor. In windows build and (as user reported) in android build this issue does not occur.
Steps to reproduce:
1. Open attached project's scene "TEST".
2. Enter play mode.
3. Open the profiler.
4. Click on "CAMERA" button few times.
5. Some little spikes are seen in profiler under Memory (GC Allocated - 0.9KB used).
6. Click on "LIGHT" button.
7. Huge spikes occur (GC Allocated - 5.7 MB)
This does not reproduce on android or windows builds. But does reproduce in both OSX and Windows 10 editors.
Reproduced on Windows 10 with 5.1.0f3, 5.3.3p3 and 5.4.0b10
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
- [VFX Graph] Base Color Map Inconsistency between Lit and Unlit Ouput
- [HDRP] Water is using the wrong depth when calculating absorption for alpha clipped transparents with depth prepass enabled
- [VFX Graph] Emissive isn't working with Decal output
- Gizmos are not drawn in Game view and Render Graph Execution errors are shown when stacked Overlay Camera is used and 'Compatibility Mode' is disabled
- Crash on WalkTypeTreeInternal when selecting the Texture of a specific FBX
This is a duplicate of issue #590565