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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Startup takes too long

Discussion in 'Editor & General Support' started by BravenBitSoftware, Sep 23, 2018.

  1. BravenBitSoftware

    BravenBitSoftware

    Joined:
    Feb 26, 2014
    Posts:
    56
    Hello, i have been developing a new project for Android and it takes over 16 seconds to load the scene. It boots fine, but after the splash screen, the screen goes black and takes too long to load. I made a bootstrap scene and added a loading script but it took the full 16 seconds to take to the bootstrap scene, THEN it took less than half a second to load the actual scene.

    The game has only 1 scene and is less than 120 megabytes. I worked on many android games before and all of them boot just fine, what's wrong? I tried searching for this problem around and the only (few) people who had this problem seemed to have either unoptimized scripting or tons of textures, which is not my case. Game is 2D.
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,449
  3. BravenBitSoftware

    BravenBitSoftware

    Joined:
    Feb 26, 2014
    Posts:
    56
    My game does make use of the resource folder but it only has a few scripts and important files. No code using RuntimeInitializeOnLoad. Also, happens on other devices.
     
  4. alexeyzakharov

    alexeyzakharov

    Unity Technologies

    Joined:
    Jul 2, 2014
    Posts:
    507
    I would recommend using profiler to see what's happening during startup.
    Use 'Autoconect Profiler' option when building player (or '-profilestartup' cmdline argument for Unity version <2018.2) to see the initialization frame.
     
    Joe-Censored and Peter77 like this.
  5. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,168
    You might want to also set
    -profiler-maxusedmemory 8388608
    (size expressed in bytes, 64 MB instead of the default 16 for players and 256 for Editor. Available since 2018.3) so that the profiler memory buffer doesn't run out of space while transmitting that amount of samples within one frame.