Search Issue Tracker

Won't Fix

Votes

0

Found in

6000.2.15f1

Issue ID

UUM-128975

Regression

Yes

368B of GC is allocated for each UI Document in the scene

-

How to reproduce:

  1. Create and open a new project
  2. Create a new UXML file in the Project tab
  3. Create a new UI Document GameObject in the Hierarchy
  4. Attach the UXML file to the UI Document Component in the Inspector
  5. Open the Analysis → Profiler
  6. Enter Play Mode
  7. Click anywhere on the CPU section in the Profiler
  8. Observe the Profiler

Actual result: 368B are allocated every frame
Expected result: 0B are allocated every frame

Reproducible in: 2023.1.0a15, 6000.2.15f1, 6000.3.0a4
Not reproducible in: 2023.1.0a14, 6000.0.63f1, 6000.3.0f1, 6000.4.0a5, 6000.5.0a2
Fixed in: 6000.3.0a5

Reproduced on: Windows 11 Pro (25H2)
Not reproduced on: No other environment tested

Note: GC.Alloc is called twice for each UI Document:
1. ”GUILayoutUtility.Begin()” - 288B
2. ”GUILayoutGroup..ctor()” - 80B

  1. Resolution Note:

    The GC allocs are caused by an editor-only OnGUI() call on UIDocument. This call was used to capture the display size, and have been removed in Unity 6.3. However, we won't backport the change since the allocation only affects the editor (the OnGUI() call is stripped from players).

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.