Search Unity

1st loadscene abnormally freezes on Android (from 5.5.2p1) "InputProcess" Issue [RESOLVED]

Discussion in 'Android' started by Guillaumzed, Mar 14, 2017.

  1. Guillaumzed

    Guillaumzed

    Joined:
    Mar 29, 2015
    Posts:
    71
    Perhaps you could help me, it's been 2 days already I'm lost on that bug.

    I've updated Unity to 5.5.2p1 and now when I'm building and running my game on android, the first time I call "loadscene" (or loadsceneasync), it takes 50 seconds (sometimes 30s) to charge any scene (even the same, first one, with almost nothing on it, while it took 5 seconds before)
    If I click again on that same loadscene afterwards, it will be quicker (5/10 seconds). But if I restart the game, it will take 50 or 30 seconds again.

    Doesn't happen on the Editor.

    When I see the profiler while running the game on android I can see the issue :

    Loading.UpdatePreloading (Alloc : 99,4% , Time ms : 52350 ms)
    --> Application.WaitForAsyncOperationToComplete
    -----> InputProcess
    (That thing is called 5109 times !!!)

    ... But I don't know what to do with it !
    Does someone know what that "InputProcess" is ?
    i'm trying to isolate the problem but still working on it ....
     
    Last edited: Mar 14, 2017
  2. Guillaumzed

    Guillaumzed

    Joined:
    Mar 29, 2015
    Posts:
    71
    Perhaps a regression of this issue that had been corrected in 5.5.1 ?
    https://issuetracker.unity3d.com/is...ich-causes-a-huge-performance-issue-on-motog4

    Just saying, because it's involving "inputprocess", which makes lose a lot of time, but I never actually saw that "unaccounted time between playerendoffframe and inputprocess" in the profiler.

    instead I have these two unaccounteds :
    - "unaccounted time between cleanup unused cached data and instantiate".
    - "unaccounted time between inputprocess and inputprocess".
     
    Last edited: Mar 14, 2017
  3. Guillaumzed

    Guillaumzed

    Joined:
    Mar 29, 2015
    Posts:
    71
    So I THOUGHT I had found a dirty fix :
    - I could'nt isolate the problem to understand what was causing these "inputprocess freezes" on the first loadscene() of my game.
    - So I just created a new fake blank first scene, in which I put in the "start" function a loadscene(1) that loads the actual first screen without delay/freeze.
    And with that, it just works.
    No more "inputprocess" freezes even with all the other loadscenes of the game.
    If that could help someone...
    I just saved half a day to roll back to 5.5.1 by finding that.

    EDIT : BUT, actually it doesn't work everytimes. I'm testing again with that fix and it isn't working after I restarted/ tried again the game twice.
    It looks like a random freeze thing now .... some garbage collector or some memory thing managed outside of my reach that deals or deals not the things.
    I'm getting tired with that... :-(
     
    Last edited: Mar 15, 2017
  4. NinjaCat

    NinjaCat

    R&D Minion

    Joined:
    Aug 22, 2013
    Posts:
    69
    Hey,

    Could you try and isolate the issue as much as possible and report a bug? If the behaviour regressed after updating to a newer unity version something is clearly going wrong.

    (Be sure to include the version you upgraded from as well!)
     
  5. Guillaumzed

    Guillaumzed

    Joined:
    Mar 29, 2015
    Posts:
    71
    Hi,
    Thanks for your comment
    YES, I've finally isolated the problem last night !!

    I had in the Update of the first screen a call to that function which uses Purchasing.

    Code (CSharp):
    1. public bool checkBool(){
    2.             bool choix = false;
    3.                     string[] tabStrings = new string[]{price1,price2,price3};
    4.                     for (int i = 0; i < tabStrings.Length; i++) {
    5.                         Product product = m_StoreController.products.WithID (tabStrings [i]);
    6.                         if (product != null) {
    7.                             if (product.hasReceipt) {
    8.                                 //Debug.Log ("receipt found break");
    9.                                 choix = true;
    10.                                 break;
    11.                             } else {
    12.                                 //Debug.Log ("4. no receipt");
    13.                             }
    14.                         }
    15.                     }
    16.             return choix;
    17.         }
    It was really not necessary to put that in the update but I had forgotten it completely.
    From 5.4 (when I started to put that function) to 5.5.1 it was okay, with no freezes when I was doing my loadscene(), from 5.5.2p1, it seems to use too much memory and the problem I described in that thread occurs at loadscene().

    Since I've removed the calls to that function from the Update function, no more freezes.

    I'll report that bug when I'll have the time to make a proper file with it to send you with.
     
    Last edited: Mar 16, 2017
  6. defic

    defic

    Joined:
    Apr 29, 2013
    Posts:
    18
    I dont know if this is related, but we also have an issue like that on Android & Unity 5.5.2p2 (also with 5.5.1p4). On editor everything works fine. On Android in some cases, the game freezes for 2-3 seconds. We can't find any explanation for this when profiling.

    We are exporting gradle project and building from there if that makes a difference.
     
  7. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    Any updates on this? I've also encountered similar regression when migrating from 5.5.0 to 5.5.4. But I cannot isolate repro.