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
- DownloadHandlerScript.CompleteContent is called twice when building for WebGL
- Scene view has Y coordinates of the Screen Position node flipped when some of the URP features are disabled
- Volumetric fog shader variants are missing from build when "Strict Shader Variant Matching" is disabled
- Unnecessary modifications clutter the Scene when using a RectTransform driven by a LayoutGroup in a Prefab
- Files in the target folder are deleted without a proper warning when building an iOS project
This is a duplicate of issue #590565