- Home /
AssetBundles, memory, and loading
Hello all, We are currently implementing the use of AssetBundles for some assets (like textures for UI, equippable items, etc) and a separate, dependent bundle for our scenes. There are a few problems related to this:
(1) It seems like we are running out of memory (because we are getting "Low memory" warnings, then everything starts shutting down). The issue is that before we started using asset bundles, everything was in the Resources folder and we didn't have blatant memory issues. These have been moved out and put into another folder that we bundle up and memory issues are now coming up. We are trying to figure out exactly what happens with memory with Resources folder as opposed to Asset Bundles. The main method for dling and using the bundles is to use LoadFromCacheOrDownload, keep a reference to the .assetBundle, then Dispose the www. Later, anything that called Resources.Load now calls assetBundle.Load. (2) In cases where we don't get a crash after loading a level and playing, we have an odd case where we have an enemy prefab that has a reference to another prefab (both being in the resource bundle). Problem is, the first run through that we get the bundle, the dependent prefab isn't loaded (it is null), even though the enemy loads fine. I've checked the editor.log, and the bundle builder is including both prefabs as expected. Oddly, if we close and reload the app, the cache loads the bundle instantly, then when we fight the enemy, it correctly has the dependent prefab loaded.
So, the questions are, what is loaded into RAM/heap space for the Resources Folder, and what is loaded into RAM/heap space for Asset Bundles? And also, what might cause a dependent prefab to not be loaded, especially on first run?
I've found this link http://forum.unity3d.com/threads/116340-memory-leak-when-using-assetbundles-on-iOS that helps a bit, but doesn't explain the difference with the Resources folder. And, it would be nice to know if he is correct in his assumptions.
I'm also trying real hard to find a solution for this, converting from using resources to asset bundle or at least some how transfer the assets from the web to the disk all at app launch, then load form disk on demand... no solutions so far.
Your answer
Follow this Question
Related Questions
Long load time for scene... Some optimization questions. 1 Answer
Prevent Resources class from loading assets when application starts 1 Answer
Are the assets of referenced assets loaded into memory? 1 Answer
Estimate Assetbundle memory Size 0 Answers
Memory problem. How do I dump a Streaming Asset from memory? 1 Answer