Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Memory Profiler 1.1.0-pre.3 NullreferenceException with captures after Player OutOfMemoryException

Discussion in 'Profiler Previews' started by re-cheid, Oct 20, 2023.

  1. re-cheid

    re-cheid

    Joined:
    Apr 10, 2017
    Posts:
    34
    Hello,

    first of all: great tool, it's super helpful, love to use it.

    Currently I'm trying to investigate why my game consumes all available memory on Linux builds only (it happens in a non-deterministic fashion).

    Here's my setup: I'm running a Linux development build (Unity 2022.3.11f1) of my Game on a remote machine and I am able to fetch memory captures which I can normally open.

    However if i take a capture after the OutOfMemoryException occurred I get the following error when trying to open it in the Memory Profiler and it won't open the snapshot:


    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. Unity.MemoryProfiler.Editor.BitConverterExt.ToInt64 (Unity.MemoryProfiler.Editor.Containers.ILongIndexedContainer`1[T] value, System.UInt64 startIndex) (at ./Library/PackageCache/com.unity.memoryprofiler@1.1.0-pre.3/Editor/Utilities/BitConverterExt.cs:158)
    3. Unity.MemoryProfiler.Editor.BitConverterExt.ToUInt64 (Unity.MemoryProfiler.Editor.Containers.ILongIndexedContainer`1[T] value, System.UInt64 startIndex) (at ./Library/PackageCache/com.unity.memoryprofiler@1.1.0-pre.3/Editor/Utilities/BitConverterExt.cs:221)
    4. Unity.MemoryProfiler.Editor.BytesAndOffset.TryReadPointer (System.UInt64& ptr) (at ./Library/PackageCache/com.unity.memoryprofiler@1.1.0-pre.3/Editor/MemorySnapshot/Cached/Managed/BytesAndOffset.cs:43)
    5. Unity.MemoryProfiler.Editor.ManagedDataCrawler.TryParseObjectHeader (Unity.MemoryProfiler.Editor.CachedSnapshot snapshot, System.UInt64 addressOfHeader, Unity.MemoryProfiler.Editor.ManagedObjectInfo& info, Unity.MemoryProfiler.Editor.BytesAndOffset boHeader) (at ./Library/PackageCache/com.unity.memoryprofiler@1.1.0-pre.3/Editor/MemorySnapshot/Cached/Managed/ManagedDataCrawler.cs:739)
    6. Unity.MemoryProfiler.Editor.ManagedDataCrawler.ParseObjectHeader (Unity.MemoryProfiler.Editor.CachedSnapshot snapshot, System.UInt64 addressOfHeader, System.Boolean& wasAlreadyCrawled, System.Boolean ignoreBadHeaderError, Unity.MemoryProfiler.Editor.BytesAndOffset byteOffset) (at ./Library/PackageCache/com.unity.memoryprofiler@1.1.0-pre.3/Editor/MemorySnapshot/Cached/Managed/ManagedDataCrawler.cs:695)
    7. Unity.MemoryProfiler.Editor.ManagedDataCrawler.CrawlPointer (Unity.MemoryProfiler.Editor.ManagedDataCrawler+IntermediateCrawlData dataStack) (at ./Library/PackageCache/com.unity.memoryprofiler@1.1.0-pre.3/Editor/MemorySnapshot/Cached/Managed/ManagedDataCrawler.cs:597)
    8. Unity.MemoryProfiler.Editor.ManagedDataCrawler+<Crawl>d__6.MoveNext () (at ./Library/PackageCache/com.unity.memoryprofiler@1.1.0-pre.3/Editor/MemorySnapshot/Cached/Managed/ManagedDataCrawler.cs:122)
    9. Unity.MemoryProfiler.Editor.SnapshotDataService.LoadSnapshot (Unity.MemoryProfiler.Editor.Format.QueriedSnapshot.FileReader file) (at ./Library/PackageCache/com.unity.memoryprofiler@1.1.0-pre.3/Editor/UI/SnapshotDataService.cs:286)
    10. Unity.MemoryProfiler.Editor.SnapshotDataService.Load (System.String filePath) (at ./Library/PackageCache/com.unity.memoryprofiler@1.1.0-pre.3/Editor/UI/SnapshotDataService.cs:94)
    11. Unity.MemoryProfiler.Editor.UI.SnapshotFileItemViewController.OpenCapture () (at ./Library/PackageCache/com.unity.memoryprofiler@1.1.0-pre.3/Editor/UI/Workbench/SnapshotFilesListItem/SnapshotFileTreeItemViewController.cs:243)
    12. Unity.MemoryProfiler.Editor.UI.SnapshotFileItemViewController.<RefreshView>b__28_1 (UnityEngine.UIElements.MouseUpEvent evt) (at ./Library/PackageCache/com.unity.memoryprofiler@1.1.0-pre.3/Editor/UI/Workbench/SnapshotFilesListItem/SnapshotFileTreeItemViewController.cs:112)
    13. UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.PropagationPhase propagationPhase) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    14. UnityEngine.UIElements.EventCallbackRegistry.InvokeCallbacks (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.PropagationPhase propagationPhase) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    15. UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    16. UnityEngine.UIElements.CallbackEventHandler.HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    17. UnityEngine.UIElements.CallbackEventHandler.UnityEngine.UIElements.IEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    18. UnityEngine.UIElements.EventDispatchUtilities.HandleEventAcrossPropagationPath (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    19. UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    20. UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToRegularTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    21. UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    22. UnityEngine.UIElements.MouseEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel iPanel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    23. UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    24. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    25. UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    26. UnityEngine.UIElements.EventDispatcher.OpenGate () (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    27. UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    28. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    29. UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    30. UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    31. UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    32. UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    33. UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    34. UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
    35. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <2a6c2bf2255f4beda040b401cc7fbbeb>:0)
    36.  
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,407
    Hello,

    Thank you for flagging this! Does the same snapshot open fine with 1.0 or a different version of the package?

    And could you please file a bug report via the Editor menu
    Help > Report a Bug 
    with the snapshot attached? If it used to open fine, we should just need the snapshot and not the entire project. Just ping this thread with the issue ID (just the IN-XXXXX number, not the link) once you get a reply from the system and I'll check it out :)