Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Feedback Memory Profiler package is missing a *good* search feature

Discussion in 'Editor & General Support' started by BSimonSweet, Feb 21, 2023.

  1. BSimonSweet

    BSimonSweet

    Joined:
    Aug 17, 2022
    Posts:
    22
    Hello,

    I'm using the Memory Profiler package right now and it get useless very quick because the search feature is terribly limited.

    On previous version, it was possible to filter almost everything (as seen on this outdated page ... https://unity.com/how-to/use-memory-profiling-unity#tree-map-filtered-table) but this feature is gone in 1.0.0 ... Why ?! Now there is only a very bare simple search field, that almost never returns something useful ...

    I have to look through a million entries to find things, I can't get any work done.
     
  2. BSimonSweet

    BSimonSweet

    Joined:
    Aug 17, 2022
    Posts:
    22
    Another feedback : it looks like it also doesn't capture all the managed memory ...

    I'm capturing a memory snapshot on an Android device. I made a test scene in which I allocate a lot of managed objects (more than a thousand). I know those objects are not Garbage Collected (that actually why I try to use Memory Profiler), but they don't appear in the memory snapshot.

    I've looked in every tabs, nothing. Most likely they should be in the "All Of Memory" tab, inside "Scripting Memory > Managed Objects", but all those objects can't be found.
     
  3. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,969
    Hi,
    We're busy preparing the 1.1.0-exp.1 release which changes the search. Right now it filters the table to only show objects who's Native Object Name matches the search. That's the UnityEngine.Object.name property, so for Components and MonoBehaviours it's the name of the GameObject they are attached to and for ScriptableObjects it's the asset file name (if it has one and isn't created at runtime and the name property is never set.

    For managed objects that do not inherit from MonoBehaviour or ScriptableObjects but which are pure C# objects, these don't have any name at all so they won't fit any search filter and won't show up unless the search string is empty.

    In 1.1.0-exp.1, the search string filters for any element in the visual tree of the table, i.e. Grouping names like "Native" or "Graphics", native type names, managed type names and native object names. Additionally, managed objects without a native object are displayed by their address hey value and native objects in same session diffs get disambiguated with sub-elements that show their instance ID. The search string is also checked against both of these in 1.1.0-exp.1. (oh and MBs and SOs get an extra layer in the Unity Objects table that splits these categories by their managed type names)

    This should hopefully make search more useful.

    We have more ideas on how to improve it further beyond that release. Once 1.1.0-exp.1 is out (should happen early next month) and should alleviate the worst pain points in this workflow I'd be very interested in hearing what other filtering capabilities you're missing beyond that and for what workflows, so we can check that against our ideas and prioritize and adapt them accordingly. (You can obviously already give me that feedback now too if you can foresee those already.)

    As for the missing objects, could that have been down to a search filter using their type name? And how are you sure that they should not be garbage collected? (Note that objects that are not referenced by anything that would keep them from being collected but just haven't yet been collected won't be found in the snapshot right now.)
     
    Last edited: Feb 22, 2023
    alexeyzakharov likes this.
  4. BSimonSweet

    BSimonSweet

    Joined:
    Aug 17, 2022
    Posts:
    22
    Hi, thanks for your answer ! I'm glad you're already working on improving the search feature :) I don't have additional feedback right now, but I'll post them here if anything come to my mind.

    As for the missing managed object in the snapshot : I made some test to allocate objects with auto GC disabled, but the objects where not referenced by anything. As you said, those can't be found right now. But in the end, in my production code, this was not actually the issue, my objects were GCed correctly. Added more logging and looked more closely with a debugger, I found my issue ^^

    Thanks again, can't wait to test the new version of the package !
     
    alexeyzakharov and MartinTilo like this.
  5. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,969