x


Max Bundle Size

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.

more ▼

asked Mar 11 '11 at 03:47 PM

raypendergraph gravatar image

raypendergraph
1.6k 15 21 37

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

I just ran into this error myself, and was able to work around it by creating a series of smaller bundles instead of one large one. From the Editor.log, it looks like Unity is running out of memory during or just after LZMA compression. As with your situation, I don't think physical memory should be an issue here, but at least the issue can be worked around.

It's quite possible that you've discovered this yourself, but you'll want to push dependencies with each successive bundle to avoid duplication of assets.

more ▼

answered Oct 17 '11 at 11:21 PM

Daniel Brauer gravatar image

Daniel Brauer
1.4k 12 19 38

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x592
x383
x328

asked: Mar 11 '11 at 03:47 PM

Seen: 1678 times

Last Updated: Oct 17 '11 at 11:21 PM