Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

(Case 975832) PackedMemorySnapshot: Missing connections between native objects

Discussion in '2017.3 Beta' started by Peter77, Dec 5, 2017.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    Using the UnityEditor.MemoryProfiler API to capture a PackedMemorySnapshot, does not include connections between various native UnityEngine objects.

    This issue occurs in a build only. Inside the editor, it works fine.

    The provided test case uses a default Cube GameObject which has a Tranform, MeshFilter, BoxCollider and MeshRenderer Component attached.

    When testing in the Editor, the "PackedMemorySnapshot.connections" array contains indices from the GameObject to each Component. This is the correct behavior.

    However, when capturing a snapshot in a player, the GameObject cannot be found anymore. The only connections, that exist in a player, are from the MeshRenderer and MeshFilter. According to my tests, this issue does not exist for every object, but for a lot.

    Please see the video attached to Case 975832 for a complete walkthrough.


    Reproduce
    • Open attached user project
    • Open Assets/Scene.unity
    • Open MainMenu > BugReport > Open TestCode Window
    • Click Capture Memory
    Notice the GameObject "QQQ Cube" references all its Components.

    • Build & run a Windows Standalone build
    • Connect profiler to Windows Standalone build
    • Open MainMenu > BugReport > Open TestCode Window
    • Click Capture Memory of Standalone build
    Observe the GameObject cannot be found and most other connections are missing too.


    Expected
    The PackedMemorySnapshot.connections array should include all connections. In the provided test case, this means the GameObject "QQQ Cube" can be found and it lists the references to its Tranform, MeshFilter, BoxCollider and MeshRenderer Components.
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619