[Solved] Unity 2021.3.8f1 Empty Scene Generates GC Alloc

Hello everyone. I am facing an issue with Unity 2021.3.8f1. I created a new project and am getting a constant 32B GC Alloc every frame. The scene is empty and only have a camera and a light. I did build the empty scene project and did deep profiling on the built project to get the info. Also I am using URP. I am sharing images of the empty scene and the deep profiler.

My question is, is there a way to fix this issue? Any help is much appreciated. Thank you.

Image of Empty Scene

Image of the Deep Profiler

I think this particular issue might be down to using URP without using the new Input system.

It might still be worth reporting a bug for this, as using Input.touches in a for a foreach in this place, instead of Input.touchCount and Input.GetTouch(int index) in a for loop seems unnecessary.

2 Likes

THANK YOU! That was indeed the issue. After downloading and installing the new input package there are no more GC alloc being generated. I think the new input system package should be automatically downloaded and installed if not having it causes garbage to be created in URP. Again thank you very much for the help it is much appreciated! :slight_smile:

1 Like

It worked for me too! Thanks!!