Search Unity

Bug Slow Editor, memory leak somewhere? Profiler says Application.WaitForAsyncOperationToComplete...

Discussion in 'Scripting' started by astracat111, Jun 15, 2021.

  1. astracat111

    astracat111

    Joined:
    Sep 21, 2016
    Posts:
    725
    So I'm having a problem in where my editor at first is fast, then gets slower and slower.

    I'm not great with understanding and debugging performance issues with the profiler but this is what I get:



    When I restart the editor, it goes fast again.

    I'm having trouble identifying when the slow down is actually starting to occur.

    1) I load scenes Async, I've heard that can cause a memory leak or something somewhere? I've heard this can cause a garbage collector problem.
    2) I use IEnumerators in the background within the editor for shortcut key purposes.
    3) I call Resources.UnloadUnusedAssets(); when loading in the data for the game initially. I've heard from another post this can cause a problem with the garbage collector running also.

    My thought is of a simple fix of some kind where I could just reset the garbage collector manually in code or something in the editor. Is this a bad idea?

    I'm not sure how to find what's causing the bug exactly to be honest.