Search Unity

Bug Animator window causes some kind of memory leak (2021.1.5f1)

Discussion in 'Animation' started by Ne0mega, Jul 6, 2021.

  1. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    755
    My computer is always on.
    Unity is always on.
    Recently I've been doing animation work, and falling asleep with the animator window open.
    When I wake up, (8 hours later or so) Unity is constantly updating (a pop up comes up that says "hold on " for about 2 seconds, then goes away, then 10 seconds later it pops up again)
    I checked the memory usage, and it is up to 13+ GB, it was nothing like that when I went to bed.
    My usual set up has the animator window as one of the windows, (I always have Game, Scene,A bunch of shadergraphs, Heirarchy, Inspector, Project, Console, and Animator windows active, and Animator is usually hidden)

    Now that I think about it, it is also what was causing this issue for me:
    https://forum.unity.com/threads/force-editor-to-release-memory.884761/#post-6984437

    I tried to blame shadergraph, but noticed sometimes even with little shadergraph work, this happened. However, I was also using animator at the time when I was working on my complex shader.

    This memory leak has been occurring for at least a year, because I remember waking up to the same thing at least a year ago a couple of times.

    For this to occur, the animator window has to be visible. If it is hidden/covered by another window, the bug does not occur.
     
    Last edited: Jul 7, 2021
    the_unity_saga and Alic like this.
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Report a bug via the Help menu.
     
  3. KalOBrien

    KalOBrien

    Administrator

    Joined:
    Apr 20, 2021
    Posts:
    89
    Please file a bug report via Help->Report a Bug.
    I'll highlight this to the team.
     
  4. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    Was googling this because I just upgraded from 2019.1 to 2020.3 LTS and now when I have the animator window open (it may only happen with animator controllers with a lot of states?) Unity starts to hang every few seconds, first for about a half a second of frames dropped, then for a second, and eventually it starts being unresponsive for quite a long time every few seconds.

    Switching scenes doesn't seem to fix it, closing the animator window doesn't fix it. Will test out workarounds like reloading editor layout. Let us know if anyone else has discovered anything.
     
    Last edited: Jul 25, 2021
  5. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    That sounds like a completely different issue to the one this thread's about.
     
  6. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    Definitely possible, I'm not going to argue I know the underlying cause of a bug I've just run into.

    But I think there are clearly some similarities here, which may have been harder to see because I left out some important detail in my first post.

    Like Ne0mega, my issue:

    -Only happens when the animator window is open and visible.
    -When the window is open, windows reports the Unity Editor's memory use skyrocketing, as in Ne0mega's issue. It goes up about a gigabyte every couple of minutes in my case.
    -This memory does not get released by the editor after closing the animator window.
    -This is accompanied by the editor freezing every few seconds. At first the freezes are short, but the longer the animator window is left visible, the longer the freezes become.
    -Eventually the freezes become long enough that an editor busy popup flashes on screen, as in Ne0gema's issue. I haven't tried falling asleep and leaving my editor open for hours.

    -According to Ne0mega, the issue has been happening for at least a year, which would include unity 2020.3 releases, the version I'm using.
     
    Last edited: Jul 26, 2021
    ejECS likes this.
  7. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Have you tried running the Profiler with Profile Editor enabled?
     
  8. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    I did briefly last night, and it looked like garbage collections may have been happening with the freezes. Once I get some work done today I'll collect actual data on it.
     
    the_unity_saga likes this.