Xcode 13.3 build "out of memory"

Hi everyone,

I'm new to iOS development and CI/CD and wondered if someone may be able to help

We have a build machine that uses Fastlane to build the app and distribute to testers etc

When the Xcode path is set to 13.1 it runs fine and it did on 13.2 (it looks like this version has automatically updated to 13.3 on the build machine)

On my local machine everything compiles fine on 13.1 AND 13.3 but now when the pipeline runs it gets to a certain package/point in the build process and fails with:

LLVM ERROR: out of memory
Allocation failed

The code branch is exactly the same, no changes to packages between Xcode builds. Any idea why 13.3 would throw a memory allocation error and what I could try next? Xcode 13.1 and 13.3 + command lines tools are both installed

Thank you!

  • Just confirmed working in the pipeline with 13.2.1 - guess it's an issue with the latest version?

  • Hi there!

    I'm my case, Xcode 13.3 was breaking with the "LLVM ERROR: out of memory" when archiving. Reading the error log, I've found something interesting: "Embedding bitcode". Well ... bitcode generation is optional. So I've disabled bitcode for that target: Build Settings -> Enable Bitcode = No. And that's it! After turning off bitcode, Xcode 13.3 was able to archive with no more "LLVM ERROR: out of memory". So search for "Embedding bitcode" in your Xcode's error log. If you find it, this is the cure ;-). If not, sorry, can't help you.

  • Thank you for the tip, I will take a look :)

    Being new to iOS development, how important is bitcode? will become mandatory at some point? My very high level. understanding is it's a step to optimise the app binaries?

Replies

I upgraded Xcode to 13.1.1, still, I'm facing the same issue.

Also, I tried -Onone instead of -Osize. That also didn't resolve it.

Stack Trace:

LLVM ERROR: out of memory
Allocation failed
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0.	Program arguments: /Users/agam.mahajan/Downloads/Xcode_13.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/agam.mahajan/Library/Developer/Xcode/DerivedData/swiggy-fpqeaxzzxjoxjtfopejvjwuvlfci/Build/Intermediates.noindex/ArchiveIntermediates/swiggy/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DLS.build/Objects-normal/arm64/RestaurantTextBlock.bc -embed-bitcode -target arm64-apple-ios11.0 -Xllvm -aarch64-use-tbi -O -disable-llvm-optzns -module-name DLS -o /Users/agam.mahajan/Library/Developer/Xcode/DerivedData/swiggy-fpqeaxzzxjoxjtfopejvjwuvlfci/Build/Intermediates.noindex/ArchiveIntermediates/swiggy/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DLS.build/Objects-normal/arm64/RestaurantTextBlock.o
1.	Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)
2.	Compiling with the current language version
3.	Running pass 'Function Pass Manager' on module '/Users/agam.mahajan/Library/Developer/Xcode/DerivedData/swiggy-fpqeaxzzxjoxjtfopejvjwuvlfci/Build/Intermediates.noindex/ArchiveIntermediates/swiggy/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/DLS.build/Objects-normal/arm64/RestaurantTextBlock.bc'.
4.	Running pass 'ObjC ARC contraction' on function '@_ZL15ASDimensionMaked'
Add a Comment

Hi,

I have the same issue with Xcode 13.3.1.

Any news?

Thanks.

Same issue in Xcode 13.3.1.

LLVM ERROR: out of memory
Allocation failed

Solution:

Build Settings -> Enable Bitcode (No)

  • Confirmed, across several machines, but turning off bitcode for us is not an option due to some other tools we're using. So we're having to downgrade to Xcode 13.0. Surely there's somewhere this can be lodged as an official bug in Xcode 13.3?

Add a Comment

Facing the exact same problem on Xcode 13.3.1. Fixed it by using UIDevice.current.userInterfaceIdiom in place of UI_USER_INTERFACE_IDIOM() as mentioned above.

This issue is fixed for me with the latest release of XCode 13.4.1 Feedback provided via https://feedbackassistant.apple.com/feedback/9993526