Copyright © 2026 Unity Technologies
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.
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:
Notes:
Issues you vote on will appear here