Search Issue Tracker
Won't Fix
Votes
3
Found in [Package]
1.21.1
Issue ID
BPSBP-668
Regression
Yes
High memory usage when in WriteSerializedFiles step while building Addressables (1000 Sprite Atlases)
How to reproduce:
1. Open the user attached project (unityclient2020.zip) on a machine with 16GB of RAM
2. Open the "Addressable Groups" window by going to the Project view, selecting the "Addressables Asset Settings" asset and pressing the "Manage Groups" button in the Inspector
3. At the top, near the search bar, open the "Build" dropdown and select: Clean Build > All
4. Open the "Build" dropdown again and select: New Build > Default Build Script
5. Open the System Monitor or Task Manager and observe the memory usage of the "Unity" process as the build is being performed
Expected result: the Editor uses about 4 to 5 GB of RAM while building
Actual result: the Editor uses more than 16 GB of RAM and up to 11GB more of swap if there is any
Reproducible with Addressables: 1.19.18 (2020.3.30f1), 1.19.19 (2021.3.0f1, 2022.1.0b14, 2022.2.0a10)
Not reproducible with Addressables: 1.19.17 (2019.4.37f1)
Reproducible on Ubuntu 20.04 and Windows 10
Note: building Addressables on Windows 10 can take up to 8 hours or more some times
Summary of the memory usage: Build involves 27,337 Texture2Ds. Most of which are referenced by Sprites that are packed into SpriteAtlases. There are 26,664 sprites and 1,044 SpriteAtlases loaded in memory.
Note: the project uses Sprite Atlas v1 but also reproduces when updated to Sprite Atlas 2 - memory usage is related to the sprite atlas system.
The same problem reproduces with native assetbundle building (e.g. 1.6GB of textures remain in memory after the build)
Although we see 1.6GB of textures lingering in memory, which seems unexpected after build is done, we don't necessarily see the 16GB usage during the builds (at least on 2023.1), so its a bit unclear if what we see is the same bug and if the user pain is so high for with what we see.
For details of investigation see port ticket: BPSBP-701
_EDIT (@davidla, copied over from Duplicate bug BPSBP-327): The reproducible versions are misleading. 1.19.17 is only tried on 2019.4. 1.19.18 on 2020.3, and so on. This reproduced for me on every version of Addressables in the 2020.3 editor, but did not reproduce for me on any Addressables version in 2019.4. To me, this indicates an engine regression rather than a package one. As a note, SBP does have scripting defines to use different APIs for building in 2020.1+, so that could also be useful._
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
- GPU utilization increases by 20% on Meta Quest headsets when Render Graph is enabled on 6000.0.16f1 and higher
- Value on Slider (Int) control in UI Builder displays as default when saving UI Document
- Color mismatch in UI Builders Library panel when the Editors theme is set to Light Mode
- [Android ] "AndroidJNI.ToBooleanArray" returns a random non-zero value instead of "IntPtr.Zero" when the method argument is null
- Non-HDR color picker opens when selecting material color with HDR enabled
Resolution Note:
There are no fixes planned for this Bug