- Home /
Why does building bundles cause unload unused assets to be called?
Currently building around 2000 bundles about which 500 are on the dependency stack (on the same level). The editor log is displaying an unload of unused assets on each bundle that's built. As I build more and more bundles, the number of assets gets larger and larger. It appears as though unity is unloading everything and reloading to build bundles.
Here is an example output:
Player size statistics Level 0 'data/dependencybundle_d062d96d/bundle_dependencybundle_d062d96d.assetbundle' uses 58.3 KB uncompressed / 58.3 KB uncompressed. Total uncompressed size 58.3 KB. Total uncompressed size 58.3 KB. System memory in use before: 1.28 GB. Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0) System memory in use after: 1.28 GB.
Unloading 63 unused Assets to reduce memory usage. Loaded Objects now: 7945. Total: 14.677408 ms (FindLiveObjects: 0.398453 ms CreateObjectMapping: 0.399657 ms MarkObjects: 12.635750 ms DeleteObjects: 0.119566 ms)
This becomes "unloading ~27,000 assets" overtime as the build continues and takes about 1.5 seconds for the unload. This makes pack building on our build servers near impossible. Does anyone know if Unity unloads all assets and reloads them when building asset bundles?
Answer by Jeff-Kesselman · Jun 19, 2014 at 10:39 PM
Im pretty sure its freeing up memory so that it has enough to build the bundle.
Sure, but it then immediately reloads the assets. For example, this is sudo what I see when building bundles that have only a few assets in them.
unloading n unloading n + 1 unloading n + 2 unloading n + 3 unloading n...
It seems that it's unloading everything on the dependency stack and then immediately reloading it, and it's accumulative. I basically have a lot of assets sitting on the dependency stack over time and it keeps unloading and reloading them.
Your answer
Follow this Question
Related Questions
AssetBundle INCREASES Memory Allocation 1 Answer
Memory Locking While Loading Issue 0 Answers
Understanding AssetBundles (WWW) BuildPipeline 1 Answer
Keeping assetbundles in memory vs always loading from cache 1 Answer
How StreamedSceneAssetBundle differ from AssetBundle in terms of scripting? 0 Answers