Search Issue Tracker
By Design
By Design in 2023.2.X
Votes
0
Found in
2020.3.45f1
2021.3.18f1
2022.2.6f1
2023.1.0b3
2023.2.0a1
Issue ID
UUM-26494
Regression
No
AssetBundle allocates more memory when loading it a second time
How to reproduce:
1. Open the attached Project "AssetBundlesLeakRepro"
2. In the Menu Bar, select "Build" -> "CompileBundle"
3. Build and Run the Project for iOS with Development Build checked
4. On a macOS device, run Instruments -> Allocations and debug the running Application on the mobile device
5. In the Build, tap the "Load bundle" -> "Unload bundle" -> "Load bundle" -> "Unload bundle" buttons with some time for the memory usage to appear in Instruments
6. Observe the Memory usage in Instruments
Expected result: Loading the AssetBundle a second time does not make the memory usage increase
Actual result: Loading the AssetBundle a second time uses more memory than the first time and the memory after unloading a bundle does not go down to the initial value
Reproducible with: 2020.3.45f1, 2021.3.18f1, 2022.2.6f1, 2023.1.0b3, 2023.2.0a1
Reproduced on:
- iOS
- Android (user-supplied information)
- MacOS Standalone (user-supplied information)
- Windows Standalone (user-supplied information)
Notes:
- The project is currently set up to build bundles for iOS
- According to the user, iOS shows the largest increase in Allocations and as such, it's easier to see the issue
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Package signature validation unexpectedly return an invalid signature status if the validation check is done after the code signing certificate validaty range has passed
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
Resolution Note:
Memory increases during the second load because of the expected behavior of an internal data structure (hashmap) and the huge number of objects loaded in the assetbundle. The first load reaches close to a capacity tipping point (45%) but then the second load happens to surpass that limit, hence the visibly larger allocation. The memory profiler snapshots are also part of the memory usage reported.
Resolution Note (2023.2.X):
Memory increases during the second load because of the expected behavior of an internal data structure (hashmap) and the huge number of objects loaded in the assetbundle. The first load reaches close to a capacity tipping point (45%) but then the second load happens to surpass that limit, hence the visibly larger allocation. The memory profiler snapshots are also part of the memory usage reported.