Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

100% CPU when Building for Android with debug folders and artifacts

Discussion in 'Editor & General Support' started by gamesAptor, Nov 25, 2021.

  1. gamesAptor

    gamesAptor

    Joined:
    Nov 25, 2021
    Posts:
    2
    Hello.

    We've just updated a project for Unity 2021.2.3f1 and we're getting problems to Compile for Android (couldn't even try yet for iOS). The project compiles fine for Windows but, without changing anything in our Build Settings we're getting an absolute incredible slowness when compiling for Android, with terrible problems.

    First we noticed that the CPU of all of our company's computers are reaching 100% CPU when compiling for Android. Secondly we noticed that when building one of the steps usually hangs and increases the CPU usage to it's maximum when building .o files in 2 different folders that are not actually required nor were being created before.

    Bellow there are many prints to show the problem and also to answer possible questions regarding build options.

    If we wait about 20 minutes (with CPU's at 100%) we can actually compile our apk and it did work without errors, but our project is not big at all to take that much to compile nor so complex to required almost frying every CPU in the company to build. Also, we couldn't find any way to disable those debug folders, which never were necessary before and now are actually the process creating all those problems mentioned above.

    Build and process and Bee/Artefacts creating many many many .o files that caps the CPU to 100% for a long period (even though the project is not big at all).
    UnityProblem.png


    Processor and CPU usage vs time and Memory consumption on one of your computers. UnityProblem2.png

    CPU usage and processes running.
    UnityProblem3.png

    Folders that are created full of specific .o files.
    UnityProblem4.png

    Configs from Build Settings, Player Settings and Project Settings:

    We tried with and without Development Build, with and without Autoconnect, with and without Deep Prof. and with and without Script Debuggin:
    UnityProblem5.png
    Tried it with and without ARM64 and ARMv7 (surely we kept at least one on)


    AOT Testes ON and OFF, with and without Optimisations
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    400
    1. It's normal and good that building takes up 100%. If it's lower it would take more time.
    2. I think the scripting backend is IL2CPP on android, and mono on desktop. IL2CPP converts c# code to c++, which runs a lot faster, but will take longer to build.
     
  3. gamesAptor

    gamesAptor

    Joined:
    Nov 25, 2021
    Posts:
    2
    I should say that this is very different from an expected behaviour.

    I mean, what actually changed for it to start building .o files that are not required nor asked and also taking around 50x the time to compile from our previous version (2019.3.4f1) and also starting using 100% of the CPUs?

    We were also using IL2CPP previously, but none of this happened nor was anything like that.
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    400
    2021.2 has incremental builds, which work different. Maybe file a bug report
     
unityunity