Search Issue Tracker
Won't Fix
Votes
1
Found in
5.4.0f3
Issue ID
888423
Regression
No
[IL2CPP] Build hangs while building a project with a large array of strings
Reproduction steps:
1. Open the attached project.
2. Make sure Scripting Backend is set to IL2CPP.
3. Build and run the project with iOS/Android platform.
- Build hangs while building to device.
Reproduced with:
5.3.8f1, 5.6.0b11, 2017.1.0a3
iOS, Android
IL2CPP
Not reproducible with:
Mono2x
---------------------------------------
Response from Dev team:
This is due to the large array initializer of strings expanding to a very large method body without any branches. The array initialization looks like a constant operation in C#, but it really gets expanded in IL to a bunch of string allocations and stores into the array.
This aggravates C/C++ compiler, especially in release, as it tries to optimize this. We will look at better handling this issue, but not likely in the near future.
As a workaround, you can load the string data from an eternal file or encode it as a stream of bytes. You can then read the data into an array yourself and avoid the time/memory expended by the C++ compiler.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Disabled assets in Import Unity Package window aren't tracked but count as being selected by user
- [Windows] Crash on GetManagerFromContext when video is playing and creating High Definition 3D Projects after FMOD failed to switch back to normal output Error appeared
- GC Alloc produced when adding items to MultiColumnListView with Auto Assign Binding
- Mouse and Pointer Events are called incorrectly in ScrollView with XRUIInputModule
- Memory leak occurs when repeatedly minimizing and maximizing the UI Builder window
Add comment