Search Unity

(Case 1052308) PackedMemorySnapshot: nativeObject.isPersistent or documentation incorrect

Discussion in '2018.2 Beta' started by Peter77, Jun 23, 2018.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,017
    While working on Heap Explorer:
    https://forum.unity.com/threads/wip...filer-debugger-and-analyzer-for-unity.527949/

    ... I observed that either the 'isPersistent' flag of a nativeObject or its documentation is incorrect.

    The documentation says:
    https://docs.unity3d.com/ScriptReference/MemoryProfiler.PackedNativeUnityEngineObject.html

    According to my tests:
    • Assets: isPersistent=true
    • SceneObjects: isPersistent=false
    • Dynamically created scene objects: isPersistent=false
    The current behavior also does make more sense to me, because this allows to differentiate between assets and scene objects, whereas if it would behave as documented, it would not allow that.

    screenshot.png

    However, it does not behave in the documented way, so I submitted this bug-report to avoid building on functionality that might not be expected and change in the future.

    Reproduce
    • Open user attached project
    • Build & Run a Windows 64bit Standalone Player
    • Connect Unity Profiler to Player
    • Click in Unity BugReport > Open TestCode Window
    • Click "Capture Memory"
    Observe in the output text that "MyTest_GameObject_In_Scene" shows isPersistent=false, but according to the documentation it should be isPersistent=true for scene objects.
     
unityunity