Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Bug Memory Profiler: GUI errors when opening a snapshot, can't diff snapshots

Discussion in 'Profiler Previews' started by DanN_HMX, Jan 11, 2019 at 7:03 PM.

  1. DanN_HMX

    DanN_HMX

    Joined:
    Mar 24, 2017
    Posts:
    2
    I've been trying out the new Memory Profiler in 2018.3 preview packages, hoping to track down some memory leaks in our game. Unfortunately I've run in to some errors while using it. I'm able to capture a snapshot from our standalone-win build, but then run in issues when I try to open that snapshot.

    First there are a bunch of warnings like this:

    Duplicated object in gc handles 1 addr:2240879204432


    The snapshot is able to load and display the tree map, but interacting with it causes these exceptions to spam:

    Exception: Unhandled exception. To get additional information add in project settings "scripting define symbols" : MEMPROFILER_DEBUGCHECK
    bad object
    at Unity.MemoryProfiler.Editor.ObjectData.FromManagedObjectIndex (Unity.MemoryProfiler.Editor.CachedSnapshot snapshot, Int32 index) [0x00072] in C:\HMX\kzero\kzero\kzero\Library\PackageCache\com.unity.memoryprofiler@0.1.0-preview.4\Editor\Profiler\ObjectData.cs:706


    (adding the MEMPROFILER_DEBUGCHECK define does not actually give any additional info)

    As well as these errors:

    GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)


    For the most part, it seems like I can navigate the UI in spite of these errors. But when I open two snapshots and try to diff them, I get the following warning, and the diff fails to open.

    Diff between tables with multiple primary key column is not supported yet. Table 'RawNativeTypeBase'


    Do you know what could be causing these errors in our memory snapshots, and is there any way to resolve or work around them from our end? I would especially like to get the diff tool working, since it would be the most useful for tracking down leaks. I can provide a snapshot file, but I can't upload it here as it's ~130MB.

    Thank you,
    Dan Nottingham
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    116
    Hi Dan,

    I can't say if there is a current workaround for this right of the bat, but could you please file a Bug Report with the 2 snapshot files you used for diffing attached? Zipping them should also reduce their size greatly. Once reported, please post the BUG ID here so we can pick it up faster. Since this is a package, once we and resolved the issue we can then update the package with that fix relatively quickly to hopefully unblock you.

    Thank you,
    Martin
     
  3. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    116
    Also, which version of the Memory Profiler Package are you using?
     
  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    116
    nevermind the previous comment, just noticed the version was in the log you posted:
    com.unity.memoryprofiler@0.1.0-preview.4
    i.e. latest.
     
  5. DanN_HMX

    DanN_HMX

    Joined:
    Mar 24, 2017
    Posts:
    2
    I've filed a bug report with the snapshots attached, 1117188. Hope that helps!
     
    LeonhardP likes this.