Search Unity

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

Question How can i accurately see the size of a field in the memory profiler?

Discussion in 'Profiler Previews' started by TJHeuvel-net, Feb 27, 2023.

  1. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    834
    upload_2023-2-27_11-5-26.png

    I'm trying to see the impact on data size for a few different approaches. When i select my script, and browse to the `localToWorlds` variable it size is reported as 8 bytes. This is perhaps the size of the (reference) variable itself, but what i am really interested in is the entire size of what it points to.

    When i for example search for the actual type it (eventually, through a dictionary and array) contains, it shows 6.3MB as total. Is there any way i can see this total-object-tree-size at a glance?
     
  2. GrahamHuws

    GrahamHuws

    Unity Technologies

    Joined:
    Mar 14, 2022
    Posts:
    20
    Hi @TJHeuvel-net! There isn't currently a solution for what you're after I'm afraid, but it's actually something that should be added as part of ongoing work. We've added your feedback, thank you!
     
    MartinTilo and TJHeuvel-net like this.
  3. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    834
    Thanks a lot!

    What information am i supposed to get out of the size column right now? The size of a pointer?
     
  4. GrahamHuws

    GrahamHuws

    Unity Technologies

    Joined:
    Mar 14, 2022
    Posts:
    20
    Yep, If it's a reference type, it'll be the size of a pointer. If it's a value type, it should be the actual size of the value :)
     
    TJHeuvel-net likes this.