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
- “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
This is a duplicate of issue #590565