- Home /
Restarted unity and it worked as expected
AssetBundle INCREASES Memory Allocation
HI, i have a login scene which goes to a dashboard scene then to one of many gametype scenes. I decided to asset bundle the different scenes to make it so that i don't have to allocate every image and prefab all the time. The problem is, using asset bundling made my game less efficient. I ran the profiler with and without bundle asset capability. So both tests go from login scene -> dashboard scene, can anyone explain this?
WITH BUNDLE ASSETS login scene total memory allocated: 0.78GB after transition to dashboard scene total memory allocated: 0.99GB
WITHOUT BUNDLE ASSETS login scene total memory allocated: 0.76GB after transition to dashboard scene total memory allocated: 0.82GB
I also tested on WebGL both versions, and once i got to the dashboard on each version, i have a debug UI display that shows memory allocation, it reflected the same ratio. And for the record i removed the scenes I'm loading from the build settings when testing the bundle asset versions
Thanks Mitch
Answer by Bunny83 · Dec 23, 2016 at 08:02 PM
What do you mean by:
so that i don't have to allocate every image and prefab all the time
If assets are actually shared between scenes the assets are only loaded once. However when you duplicate the same assets and put them into several assetbundles you will end up with more over-all memory usage.
Your question is way too abstract as we could determine how you actually used assetbundles in your case. The main point of assetbundles is to load them in at runtime, usually from an external source, so the initial size of your game / app is smaller. Assetbundles won't increase "performance". Actually the loaded bundles require some additional memory as long as they are held in memory. I'm not sure if you got the intention of AssetBundles
I mean that I have 4 scenes with completely unique and huge resources, i dont include them when i build the game because i dont want them in memory when right when the game starts, users may not even use one or many of those scenes, and having all 3 different game maps in memory when you can only possibly play one is a waste of space. I have the scenes and the prefabs and the sprites in bundles in a AWS S3 bucket. The whole point is to not have them shared between two scenes. Your "$$anonymous$$ain point" of assetBundles is exactly what i am trying to do. I will take the frame rate part out, you're right, that is irrelevant.
Follow this Question
Related Questions
Keeping assetbundles in memory vs always loading from cache 1 Answer
Why does building bundles cause unload unused assets to be called? 1 Answer
Memory Locking While Loading Issue 0 Answers
How StreamedSceneAssetBundle differ from AssetBundle in terms of scripting? 0 Answers
Unity 5 Asset Bundles with uGUI 1 Answer