To reduce the file size of our iOS game, we are now moving scenes and assets into separate uncompressed Asset Bundles and have noticed that our Asset Bundles are loaded in memory in their entirety, causing crashes on lower-end devices (some asset bundles are hundreds of megabytes). Yes, we made sure they are uncompressed, and yes, we are loading them with AssetBundle.LoadFromFileAsync
.
Example for one scene:
- Memory (on Device, through Xcode) without Asset Bundles: 155
- Memory (on Device, through Xcode) with Asset Bundles: 187
- Size of Asset Bundle: 30.3
This contradicts the following two sources:
Asset Bundle Compression
https://docs.unity3d.com/Manual/AssetBundleCompression.html
LoadFromFile(Async) - Uncompressed - Mem: no extra memory is used. Perf: reading from disk.
AssetBundle Usage Patterns
AssetBundles themselves must be carefully managed. An AssetBundle backed by a file on local storage (either in the Unity cache or one loaded via AssetBundle.LoadFromFile) has minimal memory overhead, rarely more than 10-40 kilobytes. This overhead can still become problematic when a large number of AssetBundles are present.