Search Issue Tracker

Fixed

Fixed in 1.1.3

Votes

0

Found in [Package]

1.1.0-exp.2

Issue ID

PROFB-118

Regression

Yes

[Memory Profiler] Allocated Size is smaller than Managed Size when observing Snapshot

Package: Memory Profiler

-

Reproduction steps:
1. Open the attached project "ReproProj"
2. Open the Memory Profiler (Window > Analysis > Memory Profiler)
3. Select the Snapshot “Snapshot-638170002907770372“
4. Select the "All Of Memory" tab
5. Expand Managed, Managed Objects, and then System.Byte[]
6. Select the first one, and observe the value in the Allocated Size column and the value of the Managed Size in the right panel

Expected result: Total Size and Managed Size show the same size
Actual result: Total Size and Managed Size differ

Reproducible with: 1.1.0-exp.1 (2022.2.17f1, 2023.1.0b13, 2023.2.0a11), 1.1.0-exp.2 (2022.2.17f1, 2023.2.0a11)
Not reproducible with: 0.7.1-preview.1 (2020.3.47f1, 2021.3.23f1), 1.0.0 (2022.2.17f1)
Could not test with: 1.1.0-exp.2 (2023.1.0b13) (Library\PackageCache\com.unity.memoryprofiler@1.1.0-exp.2\Editor\UI\Workbench\SnapshotFilesListItem\SnapshotFileTreeItemViewController.cs(132,55): error CS1061: 'FocusController' does not contain a definition for 'IgnoreEvent' and no accessible extension method 'IgnoreEvent' accepting a first argument of type 'FocusController' could be found)

Reproducible on: Windows 10 Enterprise 21H2

Notes:

* Snapshot is captured on an Android device using Unity Editor 2020.3.30 and Memory Profiler 0.7.1-preview.1
* The reproduction video and screenshot are attached as Repro.mp4 and Repro.png

  1. Resolution Note (fix version 1.1.3):

    These objects where incorrectly found by the managed data crawler in the Memory Profiler Package when reading the dumped heap data. They don't represent valid object data and most likely came about due to a crawler issue or UUM-53413, i.e. a timing delay between dumping the managed heap bytes and reporting Unity's native objects with GCHandles pointing at their managed heap bytes without locking the creation of new objects in between of these 2 steps, leading to the report of invalid GCHandles pointing at heap bytes that looked like a valid object (Sidenote: Boehm does not stomp over garbage collected allocations).

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.