Search Unity

Feature Request Suggestion: Ping and show preview of Asset when selected

Discussion in 'Profiler Previews' started by Zaikman, Jan 10, 2019.

  1. Zaikman

    Zaikman

    Joined:
    Aug 2, 2011
    Posts:
    17
    This was an excellent feature of the old MemoryProfiler that's still available on Unity's bitbucket. I was surprised to see it missing in this revamped version.

    Is this something you all are planning on adding back in at some point?
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,590
    Thank you for the Suggestion :)
    It is something we'd like to add at some point, yes. There are however multiple issues with it currently:
    1. The Editor + Memory Profiler that opens or even takes the snapshot doesn't necessarily have any relation to the target that is being captured. The target might be outdated or a completely different project.
    2. Once a player is built, there is no direct way to link between the assets used to build it and the instances of the assets loaded in memory at runtime. The instance ID is something that only has meaning in the context of the player, GUIDs are Editor-only IDs.
    3. Any combination of Assets (scene/mesh combines) and modifications in custom build pipelines would mean there is no relation to be made anyways.
    4. The way this is handled in these old cases is by guessing the connection between Asset in the Project <-> Asset in Memory is through the Native Object Name which is by no means guaranteed to be unique and therefore prone to be wrong.
    Now even with these caveats, trying to at least guess the connection so one can easily go from seeing an asset is taking a certain amount of memory to checking how it might look like and checking/changing the settings on it would be valuable. So far though, we've focused on making sure we're collecting and displaying accurate and comprehensive memory data and developing views that make it easy to understand it and results which can be relied on.

    Yes, the "easy to understand" part still can do with a lot of improvements and showing this kind of preview would certainly help. Ideally we'd like to be able to reduce the amount of guesswork behind such a preview though. We have gone over several ways in which we could do that but ultimately didn't have time to focus on this yet.
     
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,089
    It would be useful if you store additional information in a "development mode" build, to be able to map a native UnityEngine object in a MemorySnapshot to its asset guid in the project. Or something similar to retrieve information what the source asset in the project was.

    This functionality would allow tools to implement powerful functionality. This additional information should be stripped in non-development builds.

    I would need this functionality to properly detect asset duplicates:
    https://forum.unity.com/threads/wip...r-and-analyzer-for-unity.527949/#post-3534161

    It would also come in handy to identify the asset to display a preview, as I show in the following video:

    At the moment, I guess their paths using just the object name, which is of course quite error prone.
     
  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,590
    Yes, that would be one of the possible solutions to this. Whichever solution we choose though, it'll likely have to be for newer versions of Unity only.
     
    Peter77 likes this.
unityunity