Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

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

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

  1. deadlykam

    deadlykam

    Joined:
    Sep 10, 2015
    Posts:
    23
    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:
    32
    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 deadlykam like this.
  3. deadlykam

    deadlykam

    Joined:
    Sep 10, 2015
    Posts:
    23
    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!!