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
  2. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  3. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

(Case 989622) PackedMemorySnapshot: NativeArray memory missing

Discussion in '2018.1 Beta' started by Peter77, Jan 19, 2018.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,623
    Using the UnityEditor.MemoryProfiler API to capture a PackedMemorySnapshot, does not include allocated memory by UnityEngine.Collections.NativeArray<>'s.

    The provided example project allocates a 200 MB NativeArray. The provided snapshot example code goes over all snapshot.nativeObjects and checks if any nativeObject is greater than 150mb to identify the NativeArray memory. However, no object can be found.


    Reproduce
    • Open user attached project
    • Open Assets/Scene.unity
    • Press Play
    • Open Mainmenu > Window > Profiler
    • Select "Memory" tab in Profiler
    • Switch "Simple" dropdown to "Detailed"
    • Click "Take Sample: Editor"
    • Expand "Other" node
    Notice Unity Profiler displays "NativeArray=200 MB", which is correct.

    • Close Profiler
    • Click Mainmenu > BugReport > Open TestCode Window
    • Click Capture Memory 'Editor' button
    Observe the text displays "0 NativeArray's found, making 0 B in total".


    Expected
    Information about allocated NativeArray's should be included in a PackedMemorySnapshot.


    I submitted a few PackedMemorySnapshot bug-reports a while ago and I would appreciate if QA could process those too:
    • (Case 975832) PackedMemorySnapshot: Missing connections between native objects
    • (Case 987839) PackedMemorySnapshot: Unexpected connections between native objects
    • (Case 987987) PackedMemorySnapshot: "managedHeapSections" do not match stats in Profiler
    • (Case 989625) PackedMemorySnapshot: ExecutableAndDlls memory missing
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,623
    Is this something that is being looked into?

    I'm asking, because the current situation is that PackedMemorySnapshot became meaningless to some degree, due to missing NativeArray data in it.

    I can use PackedMemorySnapshot to read and analyze data of managed array's, but is "native memory" going to be included in a PackedMemorySnapshot too, in order to allow me to perform the same operations on the data as I can on managed data?

    This is important to me, in order to properly analyze memory.