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
- “GUIStyle” and “NullReferenceException” errors thrown in the Console when opening Object Field during script compilation
- Reflections are visible on objects without Recursive Rendering when viewed through transparent parts of another object with Recursive Rendering and Alpha Clipping enabled
- Visual artifacts appear when using "clip" method in custom shader and running on GLES
- Scaled Backgrounds List and dropdown text are enabled while Scaled Backgrounds field is disabled in IMGUI Debugger window
- Editor crashes when large value is entered in Scaled Backgrounds field of IMGUI Debugger window
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.