Search Issue Tracker
Fixed
Fixed in 6000.0.48f1, 6000.1.0b14, 6000.2.0a9
Votes
5
Found in
6000.0.42f1
6000.1.0b10
6000.2.0a6
Issue ID
UUM-99660
Regression
Yes
WASM Heap size greatly increases when UI elements are present in a WebGL build
How to reproduce:
1. Open the attached “IN-96546” project
2. Open the “SampleScene” Scene
3. Make sure that the “UIDocument” GameObject in the Hierarchy window is enabled
4. Build and run a WebGL build
5. Open the diagnostics panel by clicking the diagnostics icon under the game canvas
6. Observe the “Used WASM Heap” value
7. Delete the “UIDocument” GameObject from the “SampleScene” Scene
8. Build and run a WebGL build
9. Open the diagnostics panel by clicking the diagnostics icon under the game canvas
10. Observe the “Used WASM Heap” value
Expected result: The “Used WASM Heap” value decreases by ~10-20 MB after the second build
Actual result: The “Used WASM Heap” value decreases by ~100-110 MB after the second build
Reproducible with: 2023.1.0a22, 6000.0.42f1, 6000.1.0b10, 6000.2.0a6
Not reproducible with: 2022.3.60f1, 2023.1.0a21
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Comments (1)
-
JolanHuyvaertDieKeure
Mar 26, 2025 15:02
Thank you! Looking forward to the release of this fix. Hopefully it will be added to 6000.0 as well as we would like to start using that version for our current project. Our memory constraints are very tight, so this bug is keeping us from upgrading the project from 2022.3 to 6000.0.
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
- Reflection Probe “Probe Scene Editing Mode:” text is barely visible
- [HDRP] Game view doesn’t refresh after changing Camera Background Type until mouse moves over it
- Some Shaders appear twice in Material Shader selection menu
- Editor freezes with a StackOverflowException when certain asset types are assigned to a managed component in a SubScene via AddComponentObject
- Scale Snapping with Gizmos does not work in the Scene view when Snapping and Absolute Grid Snapping are toggled off
Resolution Note (fix version 6000.2.0a9):
This issue has been fixed in Unity for about 70Mb of the excess of memory compared to previous LTS.
However, addressing the remaining memory increase (about 25Mb) must be done in the user project. In Unity 6 the default font used by the UI Toolkit theme supports additional font features, which consumes more memory when the Font asset is first used.
This can be mitigated by importing your own font (like Inter), creating a custom Font asset, disabling the "Get font features" checkbox in the Inspector and then using that Font asset as your font for UI Toolkit.
See https://docs.unity3d.com/6000.2/Documentation/Manual/UIE-get-started-with-text.html