Search Issue Tracker

By Design

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

  1. 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.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.