Search Issue Tracker

Fixed

Fixed in 6000.3.0a2, 7000.0.0a27

Votes

0

Found in

2022.3.59f1

6000.0.40f1

6000.1.0b8

6000.2.0a5

6000.3.0a1

Issue ID

UUM-99608

Regression

No

Memory Profiler does not report struct types when they are used in static fields in IL2CPP Scripting Backend

-

How to reproduce:
1. Open the attached “TestStaticReference” project
2. Click “Build Settings” and check the “Development Build” and “Autoconnect Profiler” options
3. Doublecheck Scripting Backend in the Player Settings is set to IL2CPP (does not reproduce with Mono)
4. Click “Build And Run”
5. Once the Editor is connected to the Player: In the Editor, click Window → Analysis → Memory Profiler → Capture New Snapshot
6. In the Player, click the “Load Scene” button
7. Take another snapshot in the Editor
8. Open the second captured Snapshot → Unity Objects → Texture2D → PureBlack
9. Observe the Status

Expected result: The status should be “Used Loaded Asset”
Actual result: The status is “Unused Loaded Asset”

10. Open the first captured Snapshot → Unity Objects → Texture2D → PureBlack
11. In the references, find the "Test" object and select it
12. At the bottom of the right hand side panel, find the “Managed Fields” Section and observe

Expected result: The static sPtr field and the mState field should be listed as managed fields
Actual result: The static sPtr field is listed as managed field but not the mState field

13. Open the Test.cs file in the Assets folder and remove the double slash in the second line
14. Repeat steps 4-12 and observe the same fields

Expected result: The mState field should be listed, even if the State struct is only used in a static field.
Actual result: The mState field is only listed if the State struct is also used in a non-static field.

Reproducible with: 2022.3.0f1, 2022.3.59f1, 6000.0.40f1, 6000.1.0b8, 6000.2.0a5

Reproducible on: Windows 11 Pro (by user), MacOS 15.3.1 (M1 Max)
Not reproducible on: No other environments tested

Notes:
- Not reproducible in Editor
- Not reproducible with Mono scripting backend

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.