Search Unity

Bug [Solved] Unity 2021.3.8f1 Empty Scene Generates GC Alloc

Discussion in 'Editor & General Support' started by KamranWali, Aug 13, 2022.

  1. KamranWali

    KamranWali

    Joined:
    Sep 10, 2015
    Posts:
    24
    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
     
  2. Skiriki

    Skiriki

    Joined:
    Aug 30, 2013
    Posts:
    69
    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.
     
    alexeyzakharov and KamranWali like this.
  3. KamranWali

    KamranWali

    Joined:
    Sep 10, 2015
    Posts:
    24
    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! :)
     
    Last edited: Aug 13, 2022
    DevDunk likes this.
  4. funkyOrange

    funkyOrange

    Joined:
    Oct 14, 2018
    Posts:
    1

    It worked for me too! Thanks!!