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. Dismiss Notice

Bug EditorOnly [GetComponentNullErrorWrapper] creating 15.9MB Garbage on every ScriptReload

Discussion in 'Editor & General Support' started by John_Leorid, Mar 25, 2021.

  1. John_Leorid

    John_Leorid

    Joined:
    Nov 5, 2012
    Posts:
    624
    On every script reload, this strange entry appears in the profiler, creating a huge amount of garbage which slows down iteration times significantly.

    What is this? How can I get rid of it?
    Using Unity Version 2020.1.17f1

    Edit: We don't have any MissingComponents in our Scenes, I made a script to check and remove them, using
    RemoveMonoBehavioursWithMissingScript()
    .

    (next line is also very strange - calling GC.Alloc 1.699.287 times on script reload? All in all Script Reloading takes 32 seconds, every single time - I want to fix this, somehow)

    upload_2021-3-25_16-8-6.png
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,156
  3. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    943
    Can it be temporarily removed? These extra calls has no use to us.
     
  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,156
    Without further details, like e.g. some callstacks for these allocations I'm not sure I can give you any answer to this. I'm not even sure if I would share your assessment that the extra calls (I'm assuming you mean GC.Allocs caused by the GetComponentNullErrorWrapper calls that are marked as EditorOnly?) have no use for you, though I can appreciate that it might seem like that without you getting direct error logs in the console.