Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Unity freeze on long run application after migrate to unity 2019.3

Discussion in 'Editor & General Support' started by DovitItalia, Jun 8, 2020.

  1. DovitItalia

    DovitItalia

    Joined:
    Mar 23, 2020
    Posts:
    50
    Hi everyone, I updated unity from version 2019.2.18 to unity 2019.3.5 one month ago, since then I saw our application freezing randomly.

    I spent the last copule of week testing every aspect of my code/editor to try to find (and sistematically reproduce) the error without success. I'm sorry to say it but unity is the one to blame here, I share here my experience to see if someone else found the same problem, or at least to help unity devs to debug this.

    I make Home automation applications. Only UI is involved, most of the work is done in background. The app is installed in our final users touchscreen (We have different products, mostly android based, but some windows or linux too) The app is meant to work forever, silently communicating with our smart server and it "should" be so light that (till now) we saw decent up-time without errors or watchdog triggers.

    (We notice the freeze early appears only on a custom Android 6.0, but we saw this on standard phones too)
    During those weeks I monitored the behavior of our application using Android Profiler, Unity Profiler (production and development build) and checking the android logCat.
    When the freeze occurs, the only evidence I found is that, from the android profiler list of Threads, I can see the thread named "filter0" and "filter1" going crazy high on running time, causing the app to freeze. The freeze is totally random, we tried both with the tinies and the biggest configuration scenarios, we tried with our Demo and without a server connection, we tried a lot, still random freezes.

    Now we are going to develop only with unity 2019.2 because we tried different .3 versions, each one with the same behavior, any thought?

    thanks
     
  2. DovitItalia

    DovitItalia

    Joined:
    Mar 23, 2020
    Posts:
    50
    Here I catched the behavior, the app was just on idle state, left there on our test device, as you can see after around 2 hour of runtime the thread "filter0" started spamming, shorted followed by "filter1", causing the app to freeze and watchdog restarting it

    (those threads are not threads that I start, but something that Android itself, or unity, does
     

    Attached Files:

  3. DovitItalia

    DovitItalia

    Joined:
    Mar 23, 2020
    Posts:
    50
    I just updated to unity 2019.4 LTS, but the issue is still there (freezes randomly, some freeze took 10 min to appear, some others after 2/3 hours of runtime). Could it be a problem similar to this one? https://forum.unity.com/threads/what-is-preparerendertarget-doing.908348/. I can see that, when the app starts to slow just before the freeze the profiler show me in the CPU timeline the "WaitForTargetFPS" process going high on number
     
  4. jayderyu

    jayderyu

    Joined:
    Dec 28, 2015
    Posts:
    17
    @DovitItalia and anyone else. I had something similar to this happen to me in a project I worked on recently. In fact during one of my tests I created a new project with nothing in it. Then let it run for an hour and I still ended up with a lock down.

    Filter 0 was using 100% of the capacity of the system after awhile. The solution was found in an unlikely place.

    The problem came up as a situation from two sources
    1) It only occurred on LG devices for us(maybe others will occur on other devices). This led us that it has something to do with the thread implementation happening on these devices.

    2) Turn off Optimized Frame Pacing. If it's ON set it to OFF. Get rid of it.
    upload_2021-3-29_7-8-22.png


    Once this was done, like magic the project had no issues afterwards.
     
  5. DovitItalia

    DovitItalia

    Joined:
    Mar 23, 2020
    Posts:
    50