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. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

IL2CPP Android Build LLVM Error: out of memory

Discussion in 'Android' started by Ughuuu, Dec 30, 2019.

  1. Ughuuu

    Ughuuu

    Joined:
    Jul 9, 2013
    Posts:
    2
    Hello, I am having an issue with the build. If anyone has any knowledge with this, I would be grateful.

    I am building my game for android using IL2CPP and am seeing a crash in clang.exe with out of memory. The clang.exe uses around 12GB of RAM, memory usage goes up to around 96% then the build fails. I am using Unity version 2019.3.0f3. I am also using tiles heavily in the game and Scriptable Objects as well. I know this is little to go on, but I'm not sure what else to say that could help.

    I have already reported a bug. I am writting here to see if there is however a quick fix for this.

    Thanks in advance.

    Here is the error I am receiving:
    Code (CSharp):
    1. Failed running C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARMv7" --configuration="Release" --outputpath="C:\Users\daian\Documents\Bitbucket\DungeonCrawlTycoon\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a\libil2cpp.so" --cachedirectory="C:\Users\daian\Documents\Bitbucket\DungeonCrawlTycoon\Assets\..\Library\il2cpp_android_armeabi-v7a/il2cpp_cache" --additional-include-directories="C:/Program Files/Unity/Hub/Editor/2019.3.0f3/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="C:/Program Files/Unity/Hub/Editor/2019.3.0f3/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\libil2cpp/include" --tool-chain-path="C:/Program Files/Unity/Hub/Editor/2019.3.0f3/Editor/Data/PlaybackEngines/AndroidPlayer/NDK" --profiler-report --map-file-parser="C:/Program Files/Unity/Hub/Editor/2019.3.0f3/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --directory=C:/Users/daian/Documents/Bitbucket/DungeonCrawlTycoon/Temp/StagingArea/assets/bin/Data/Managed --generatedcppdir=C:/Users/daian/Documents/Bitbucket/DungeonCrawlTycoon/Temp/StagingArea/Il2Cpp/il2cppOutput
    2.  
    3. stdout:
    4. Building libil2cpp.so with AndroidToolChain
    5.     Output directory: C:\Users\daian\Documents\Bitbucket\DungeonCrawlTycoon\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a
    6.     Cache directory: C:\Users\daian\Documents\Bitbucket\DungeonCrawlTycoon\Library\il2cpp_android_armeabi-v7a\il2cpp_cache
    7. il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: LLVM ERROR: out of memory
    8. Wrote crash dump file "C:\Users\daian\AppData\Local\Temp\clang++.exe-e15b47.dmp"
    9. LLVMSymbolizer: error reading file: PDB Error: DIA is not installed on the system
    10.  
    11. LLVMSymbolizer: error reading file: PDB Error: DIA is not installed on the system
    12.  
    13. LLVMSymbolizer: error reading file: PDB Error: DIA is not installed on the system
    14.  
    15. #0 0x000000000107b747 C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0xc7b747 (C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe+0xc7b747)
    16. #1 0x000000000107b747
    17. #2 0x000000000107b747 (C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe+0xc7b747)
    18. #3 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0xc31f77 C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x6f894e
    19. #4 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x6fdff5 C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x6fe270
    20. #5 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x7ca45a C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x7cb1af
    21. #6 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x6f43ee C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x907598
    22. #7 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x907763 C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x907e9e
    23. #8 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0xde09bc C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x28399c2
    24. #9 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x1a23ee2 C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x14a84c6
    25. #10 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x119e526 C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x11789c5
    26. #11 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x121dcb1 C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x2f8c
    27. #12 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x2a865fd C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x13b5
    28. #13 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x14e8 (C:\WINDOWS\System32\msvcrt.dll+0x2ae7b)
    29. #14 0x00007ffb0457ae7b
    30. #15 0x00007ffb0457ae7b (C:\WINDOWS\System32\msvcrt.dll+0x2ae7b)
    31. 0x000000000107B747 (0x0000000000000016 0x0000000025CF8000 0x0000000000000016 0x00007FFB045E46B8)
    32. 0x00007FFB0457AE7B (0x0000000000000001 0x00007FFB05786653 0x0000000000000000 0x000000000390832A), raise() + 0x21B bytes(s)
    33. 0x00007FFB0457F28B (0x0000000000000002 0x0000000000000000 0x000000000390832A 0x00007FFB04557DA9), abort() + 0x1B bytes(s)
    34. 0x0000000001031F77 (0x000000001F4E2D58 0x00000003B81CAFB8 0x00000003B81CAFB8 0x00000000034A7400)
    35. 0x0000000000AF894E (0x000000001243D5E0 0x000002DD0577FC11 0x0000000004EADA60 0x00000003A38A6020)
    36. 0x0000000000AFDFF5 (0x0000000000004E83 0x0000000012119760 0x00000002515737D0 0x00007FFB04569DA0)
    37. 0x0000000000AFE270 (0x0000000002560296 0x00000000000000E0 0x0000000000000000 0x0000000004EB0000)
    38. 0x0000000000BCA45A (0x000000000C7E43D0 0x0000000000000039 0x0000000004EADBB0 0x000000000AD53890)
    39. 0x0000000000BCB1AF (0x0000000004EADC10 0x0000000000D04AF5 0x000000000C599048 0x000000000AD53890)
    40. 0x0000000000AF43EE (0x000000000A2F54F8 0x000000000C9052C0 0x00000000098CDAE8 0x000000000000006E)
    41. 0x0000000000D07598 (0x00000000098DB000 0x000000000BAD94A0 0x00000000098B88D0 0x00000000098B88D0)
    42. 0x0000000000D07763 (0x00000000098DB000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
    43. 0x0000000000D07E9E (0x0000001000000000 0x0000000000000000 0x0000000004EAE030 0x0000000004EAE3B0)
    44. 0x00000000011E09BC (0x0000000000000000 0x0000000001E2BADC 0x0000000000000001 0x0000000004EAE340)
    45. 0x0000000002C399C2 (0x0000000000000000 0x000000000D219400 0x0000000000000001 0x0000000000000000)
    46. 0x0000000001E23EE2 (0x0000000004EB0000 0x00000000098A8C90 0x0000000004EAE5D0 0x0000000004EAE530)
    47. 0x00000000018A84C6 (0x0000000004EAE820 0x00000000018A6395 0x0000000004EAE820 0x00007FFB04569DA0)
    48. 0x000000000159E526 (0x0000000004EAE6C0 0x0000000A00000008 0x0000000000000000 0x000014F4000014E7)
    49. 0x00000000015789C5 (0x00000000080F9F30 0x0000000000000001 0x00000000098A6C20 0x00007FFB04569DA0)
    50. 0x000000000161DCB1 (0x00000000098A4DA0 0x00000000080F9190 0x0000000000000039 0x000000000102D8B9)
    51. 0x0000000000402F8C (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x000000000000004C)
    52. 0x0000000002E865FD (0x0000000000000089 0x00000000098B6050 0x0000000000000000 0x0000000000000000)
    53. 0x00000000004013B5 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
    54. 0x00000000004014E8 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
    55. 0x00007FFB03E87BD4 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), BaseThreadInitThunk() + 0x14 bytes(s)
    56. 0x00007FFB057ACED1 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), RtlUserThreadStart() + 0x21 bytes(s)
    57. clang++.exe: error: clang frontend command failed due to signal (use -v to see invocation)
    58. Android (5058415 based on r339409) clang version 8.0.2 (https://android.googlesource.com/toolchain/clang 40173bab62ec746213857d083c0e8b0abb568790) (https://android.googlesource.com/toolchain/llvm 7a6618d69e7e8111e1d49dc9e7813767c5ca756a) (based on LLVM 8.0.2svn)
    59. Target: armv7-unknown-linux-android19
    60. Thread model: posix
    61. InstalledDir: C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin
    62. clang++.exe: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
    63. clang++.exe: note: diagnostic msg:
    64. ********************
    65.  
    66. PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
    67. Preprocessed source(s) and associated run script(s) are located at:
    68. clang++.exe: note: diagnostic msg: C:\Users\daian\AppData\Local\Temp\Assembly-CSharp-884182.cpp
    69. clang++.exe: note: diagnostic msg: C:\Users\daian\AppData\Local\Temp\Assembly-CSharp-884182.sh
    70. clang++.exe: note: diagnostic msg:
    71.  
    72. ********************
    73.  
    74.  
    75. Invocation was: Executable: "C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++"
    76. Arguments: -DNET_4_0 -DUNITY_AOT -DIL2CPP_MONO_DEBUGGER_DISABLED -DGC_NOT_DLL -DRUNTIME_IL2CPP -DLINUX -DANDROID -DPLATFORM_ANDROID -D__linux__ -D__STDC_FORMAT_MACROS -I"C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\bdwgc\include" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\libil2cpp\include" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\il2cpp\libil2cpp" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\il2cpp\libil2cpp" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\il2cpp\external\bdwgc\include" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\il2cpp\external\xxHash" -I"C:\Users\daian\Documents\Bitbucket\DungeonCrawlTycoon\Temp\StagingArea\Il2Cpp\il2cppOutput" -I"." -c -g -DNDEBUG -fexceptions -fno-limit-debug-info -fdata-sections -ffunction-sections -Wa,--noexecstack -fno-rtti -std=c++11 -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -fno-strict-overflow -fno-addrsig -fPIC -Os -stdlib=libc++ -target armv7-linux-androideabi19 -D__ANDROID_API__=19 -march=armv7-a -mfloat-abi=softfp -mfpu=neon-fp16 -Wno-unused-value "C:\Users\daian\Documents\Bitbucket\DungeonCrawlTycoon\Temp\StagingArea\Il2Cpp\il2cppOutput\Assembly-CSharp.cpp" -o "C:/Users/daian/Documents/Bitbucket/DungeonCrawlTycoon/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/B175D48562CD48B28DFC2C289FC4A8C7.o"
    77.  
    78.   at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
    79.   at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    80.   at il2cpp.Program.DoRun(String[] args, List`1 foundAssemblies)
    81.   at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
    82.   at il2cpp.Program.Main(String[] args)
    83. stderr:
    84.  
    85. Unhandled Exception: Unity.IL2CPP.Building.BuilderFailedException: LLVM ERROR: out of memory
    86. Wrote crash dump file "C:\Users\daian\AppData\Local\Temp\clang++.exe-e15b47.dmp"
    87. LLVMSymbolizer: error reading file: PDB Error: DIA is not installed on the system
    88.  
    89. LLVMSymbolizer: error reading file: PDB Error: DIA is not installed on the system
    90.  
    91. LLVMSymbolizer: error reading file: PDB Error: DIA is not installed on the system
    92.  
    93. #0 0x000000000107b747 C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0xc7b747 (C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe+0xc7b747)
    94. #1 0x000000000107b747
    95. #2 0x000000000107b747 (C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe+0xc7b747)
    96. #3 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0xc31f77 C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x6f894e
    97. #4 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x6fdff5 C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x6fe270
    98. #5 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x7ca45a C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x7cb1af
    99. #6 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x6f43ee C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x907598
    100. #7 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x907763 C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x907e9e
    101. #8 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0xde09bc C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x28399c2
    102. #9 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x1a23ee2 C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x14a84c6
    103. #10 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x119e526 C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x11789c5
    104. #11 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x121dcb1 C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe 0x2f8c
    105. #12 0x00007ffb0457ae7b C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\ll<message truncated>
     

    Attached Files:

  2. exltus

    exltus

    Joined:
    Oct 10, 2015
    Posts:
    58
    any solution?
     
  3. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,258
  4. exltus

    exltus

    Joined:
    Oct 10, 2015
    Posts:
    58
    I set 10gigs - 30gigs but build still failing (I have 12bg ram)
     
  5. exltus

    exltus

    Joined:
    Oct 10, 2015
    Posts:
    58
    I set 130 gigs - and after 6 hours of building unity freezes - my explorer looks like this (sorry screen contains in czech language) but oyu can claerly see, taht uniy eats over 124 gigs of memory... I assume, that it is not normal beahve
     

    Attached Files:

    • bug0.png
      bug0.png
      File size:
      67.8 KB
      Views:
      426
  6. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,258
    Can you paste the case number here please? It might be that some script in your project creates huge cpp files.

    The cpp files are generated here - C:/Users/daian/Documents/Bitbucket/DungeonCrawlTycoon/Temp/StagingArea/Il2Cpp/il2cppOutput check if there are any huge ones, that might hint you what the problem is.
     
  7. exltus

    exltus

    Joined:
    Oct 10, 2015
    Posts:
    58
    what do you mean by "case number"?
     
  8. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,258
    You said "I have already reported a bug. ", you should have received an email with bug link, it contains a number of your Case
     
  9. exltus

    exltus

    Joined:
    Oct 10, 2015
    Posts:
    58
    Ohhh I see. But I am not creator of this topic... I only facing exactly same error...
     
  10. exltus

    exltus

    Joined:
    Oct 10, 2015
    Posts:
    58
    Ok I tryed another build - Iam attaching screenshot of cache direcotry (it does not look like that there are some huge files) - total cache directory size is 511 MB.
    Iam also including my build log
     

    Attached Files:

  11. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,258
    I am sorry, I should have read more carefully.

    Still, I think you should create a bug report with repro attached, since otherwise it's only guesses on what's happening.

    You pasted a screenshot with object files, what about cpp files, are there any huge ones?

    P.S as you saw, the bug happens in Android's native compiler which is a part of Android NDK, so we can only workaround the problem here, the fix (if there's really a bug) must come from google.
     
  12. exltus

    exltus

    Joined:
    Oct 10, 2015
    Posts:
    58
    no there are non ".so" files generated - only files ".o"
     
  13. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,258
    what about .cpp files?
     
  14. exltus

    exltus

    Joined:
    Oct 10, 2015
    Posts:
    58
    none... only ".o" files nothing more
     
  15. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,258
    There should be cpp files in E:/Dev/AoLArena/Unity/Temp/StagingArea/Il2Cpp/il2cppOutput right after the build, unless you're closing Unity, then the whole folder is deleted.
     
  16. exltus

    exltus

    Joined:
    Oct 10, 2015
    Posts:
    58
  17. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,258
    That's a lot, by might be normal for your project, in the build report above , the compiler crashed when compiling

    C:\Users\daian\Documents\Bitbucket\DungeonCrawlTycoon\Temp\StagingArea\Il2Cpp\il2cppOutput\Assembly-CSharp.cpp

    Preprocessed version was placed here - C:\Users\daian\AppData\Local\Temp\Assembly-CSharp-884182.cpp, try opening it, and see if there's a huge method inside, it might be the reason for compiler to crash.

    If that's the case, you might need to split the method into smaller ones
     
    RenanRL likes this.
  18. exltus

    exltus

    Joined:
    Oct 10, 2015
    Posts:
    58
    YES! problem solved - there was arrays with hundres of elements and il2cpp was unable to compile it... I moved data to text file, and Iam loading it from it and build passed... Thanks for oyur help!
     
    djtim3000 and Tomas1856 like this.
  19. djtim3000

    djtim3000

    Joined:
    Jun 5, 2018
    Posts:
    2
    I had the same issue after switching to IL2CPP and it was driving me crazy. Thank you for finding the solution!
    The same issue with some large arrays causing the compiler to eat up all my memory and eventually crash.
     
  20. Deleted User

    Deleted User

    Guest

    Hello, when try build Android build IL2CPP (netstandart 2.0) for ARM64 architectur an error occurse. (Unity 2021.2.0b4)
    Assembly for mono and windows works properly.
    There are no huge arrays or large static objects in the code.
    I tried different configuration options with IL2CPP,
    I ask for help with debugging, where should I pay attention?

    part of Editor.log events:
    ------------------------------

    Code (csharp):
    1.  
    2. [2243/2254 550s] C_Android_arm64 Library/Bee/artifacts/Android/d8kz/0r23_Transforms.o
    3. [1402/2254  6s] C_Android_arm64 Library/Bee/artifacts/Android/d8kz/mbiv_System3.o
    4. ##### Output
    5. 'Function Pass Manager' on module 'C:/Repositories/BS_Test/Library/Bee/artifacts/Android/il2cppOutput/cpp/System3.cpp'.
    6.  
    7. 4.    Running pass 'Loop Pass Manager' on function '@Regex_GetGroupNumbers_mCA65A8628D4B96209FAF480F6172039CBEBE08A9'
    8.  
    9. 5.    Running pass 'Unroll loops' on basic block 'LLVM ERROR: out of memory
    10.  
    ----------------------------------------------------------------
     

    Attached Files:

    Last edited by a moderator: Jul 29, 2021
  21. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,299
    Does this always happen for the C:/Repositories/BS_Test/Library/Bee/artifacts/Android/il2cppOutput/cpp/System3.cpp file? Or does it occur for different source files?

    In that generated code, I see one pretty large method: the static constructor for System.Text.RegularExpressions.RegexCharClass.

    That is in the base class library code, so you can't modify it, but I wonder if it is causing the problem. Does something in the project code use System.Text.RegularExpressions?
     
  22. Deleted User

    Deleted User

    Guest

    Thanks for the quick response.
    It's strange, the project doesn't require regular expressions at all. Search did not give any occurrences in the System.Text.RegularExpressions namespace.
    I tried to build again, this time the stack point to 5 LLVM errors in this files by stacktrase (Editor.log part attached):
    Unity.TextMeshPro.cpp
    Unity.Mathematics9.cpp
    Unity.InputSystem4.cpp
    UnityEngine.TextCoreTextEngineModule.cpp
    Unity.Mathematics.cpp
     

    Attached Files:

  23. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,299
    Ok, so the error does not seem to be specific to that file. Quick question - how much memory is available on this computer? Maybe it is really running out of memory.
     
  24. Deleted User

    Deleted User

    Guest

    I have Windows 10 x64, 16GB RAM and now manualy setted 32 GB virtual memory

    Sometime can get other error:
    additional relocation overflows omitted from the output
    clang++: error: linker command failed with exit code 1 (use -v to see invocation)
     

    Attached Files:

  25. Deleted User

    Deleted User

    Guest

    This error is reproducible on other computers as well. But another project for the 2019 lts version is building correctly
     
  26. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,299
    Ok, so this computer definitely has enough memory! :)

    This "relocation overflows" error is a sign that the executable code it too large for the Android NDK linker to handle. Do you happen to have "Script Debugging" enabled for this project? That will increase the code size and can push some projects over this limit.
     
  27. Deleted User

    Deleted User

    Guest

    Yes, debug mode is enabled and the build is done with breakpoint support. I switched to release mod and also got "additional relocation overflows omitted from the output error" (
     
  28. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,299
    In "release mode" do you still have script debugging enabled?
     
  29. Deleted User

    Deleted User

    Guest

    Yes, i wanna debug my projects) The Release mod + release build gives me an apk file, but when launched on the device it crashes after the logo splashscreen. I'm sure the runtime logic doesn't contain bugs or platform-specific initialization which could cause a crash. It is very strange that the mono and Windows assemblies are launched. I also tried replacing the ndk with the manually downloaded one
     
  30. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,299
    Ok, to be clear then, this error occurs only when the "Script Debugging" option is enabled, is that correct? And this is happening with Unity 2021.2.0b4?
     
  31. Deleted User

    Deleted User

    Guest

    Exactly, and only with IL2CPP for x64
     
  32. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,299
    Thanks for confirming that.

    Can you try one other option? In the Build Settings dialog, can you change the "IL2CPP Code Generation" setting to the value "Faster (smaller) builds"? This should decrease the code size for the final build, and may allow you to work around this Android NDK limitation.
     
  33. Deleted User

    Deleted User

    Guest

    Sorry for the delay in answering. After some experimentation, I came to the conclusion that script debugging is to blame:
    1. I created an empty URP project in the 2020.3.14 LTS and add the necessary packages (ECS, cinemachines, addressable and others), then the dev assembly with script debugging will be build and run on device successful.
    2. Then add 20 code assemblies of scripts using these packages to them (about 500 code files) then the dev assembly with debugging crashes with an error - "additional relocation overflows omitted from the output"

    As a result, I came to the conclusion that debugging becomes impossible when ~ 200 scripts are reached. At the moment, the most convenient way to work with the device is the LogCat and make release builds
     
  34. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,299
    Thanks for the investigation and the details, I appreciate the feedback!

    It seems like you have a work around for the moment. We also have some options on our end to lower the code size to improve this behavior and avoid bumping up against the Android NDK limitations that we will explore.
     
  35. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    761
    2022.1.0b2

    I still got the same failed `LLVM ERROR: out of memory` for script debugging enabled

    This is very sad that I need to debug my project in android. And unity just not let me do it
     
    Qbit86 likes this.
  36. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,299
    Our changes to use lld from the Android NDK should work around this issue, but those won't be until 2022.2.

    I think your best option then is to try to lower the code size in the project (which may not be possible). You could also use the Mono scripting backend to debug on Android.
     
    Thaina likes this.
  37. makcimbx

    makcimbx

    Joined:
    Aug 29, 2017
    Posts:
    9
    Change Master to Release option in l2cpp raised the size of aab from 140 to 160. I understand that the problem is in android ndk, but you really can’t do anything about it within the framework of at least 2021.2?
     
  38. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,299
    No, from what I understand the change to use the r23 NDK was pretty significant, so it won't be back ported to Unity version 2021.2.