Are there limits (practical or documented) that exist for building asset bundles. We have a situation where last year we were running out of memory (heap, presumably not physical) during building. We have since taken much of the assets and stored them in a set of asset bundles that are built from the command line with headless Unity. We are now running into memory problem again and I am wondering if we are just abusing the build pipeline or is there a bug. Again, these machines have 16GB of RAM so this is not physical memory.
What is different about the bundle that started causing the problem is that there are a lot of character prefabs that have a fair amount of FBXs that were added. The nature of the character models have not changed they are just more complex. This is actually one of our smaller bundles size wise, but the others do not contain the characters. Here is the asset bundle build preamble....
Textures 6.5 mb 1.3%
Meshes 402.7 mb 78.5%
Animations 20.2 mb 3.9%
Sounds 10.4 mb 2.0%
Shaders 28.6 kb 0.0%
Other Assets 71.4 mb 13.9%
Levels 0.0 kb 0.0%
Scripts 0.6 kb 0.0%
Included DLLs 0.0 kb 0.0%
File headers 1.8 mb 0.3%
Complete size 513.0 mb 100.0%
...
...
...
Unity(22120,0xa0742540) malloc: *** mmap(size=537911296) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Out of memory!
UnityEditor.BuildPipeline:BuildAssetBundleInternal(Object, Object[], String[], String, BuildAssetBundleOptions, BuildTarget)
UnityEditor.BuildPipeline:BuildAssetBundleExplicitAssetNames(Object[], String[], String, BuildAssetBundleOptions, BuildTarget)
AssetBundleExportTool:Export(BundleModel) (at Assets/Editor/AssetBundleExportTool.cs:289)
AssetBundleExportTool:ExportBundles(IEnumerable`1) (at Assets/Editor/AssetBundleExportTool.cs:116)
AssetBundleExportTool:Update() (at Assets/Editor/AssetBundleExportTool.cs:249)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
UnityEditor.HostView:Invoke(String, Object)
UnityEditor.HostView:Invoke(String)
UnityEditor.HostView:SendUpdate()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
[/Applications/buildAgent/work/71ca6fec1b41cc30/Projects/../Editor/Src/Application.cpp line 2139]
(Filename: Assets/Editor/AssetBundleExportTool.cs Line: 289)
Edit: 3/22 Absolutely no word from Unity either way on this bug. I am almost certain that it has something to do with the animations. We have had more failures on other bundles now and in ever case can be traced back to a commit that made the bundle include a character with many prefabs. 20 MB does not sound like a ton of animations though.