Search Unity

Bug [Fixed] (Case 1115073) References to Native Objects that do not make sense

Discussion in 'Profiler Previews' started by pavelkouril, Jan 7, 2019.

  1. pavelkouril

    pavelkouril

    Joined:
    Jul 22, 2016
    Posts:
    127
    I think this might be the same issue as 987839, but that was reported using the older API, not using the new memory profiler, so I would not call this as a duplicate. See more info at https://forum.unity.com/threads/wip...analyzer-for-unity.527949/page-2#post-3619123

    However, I doubt this is really By Design, even though the older issue was closed with this resolution. :(

    We are getting references (like 1000+ references) to every terrain Mesh, even thought the objects that allegedly reference it are GUI objects etc.; you can find the one real reference (MeshCollider) between the references as well, but the rest are nonsense and should not be referencing the Mesh.

    I have uploaded a snapshot from a real project where you can check these wrong references with the bug report; you can find it as Case 1115073.
     
    Peter77 likes this.
  2. G_Wojo

    G_Wojo

    Unity Technologies

    Joined:
    Feb 8, 2017
    Posts:
    12
    Thanks we will look into this issue once again and depending on outcome:
    • create fix
    • give longer explanation why this data is reported the way it is
     
  3. pavelkouril

    pavelkouril

    Joined:
    Jul 22, 2016
    Posts:
    127
    Thanks!

    Yeah, I guess either of those is a fair game; having at least an understanding why it acts that way would be nice, but proper fix would be better (unless Unity really references native object between each other in the most befuddling ways). :)
     
  4. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,092
    Have you heard back from them yet?
     
  5. pavelkouril

    pavelkouril

    Joined:
    Jul 22, 2016
    Posts:
    127
    Well, it seems they just auto closed the issue and I missed the email, because I did not provide a repro, just the snapshot. I will try to get it reopened, because this issue is really really annoying. :/
     
  6. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,595
    From our reply to that bug, for the public record ;)
     
  7. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,092
    It unfortunately it doesn't seem to sound like the problem I've seen, where a Mesh has references to an AudioSource for example. Or could it be same as well?

    Thanks for the quick reply!
     
  8. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,595
    It could be. The current snapshot code collects references by going through everything that has pointers to each other. So if your Audio Source is on a GameObject with a Mesh on it, the Audio Source has a reference to the Gameobject, which has a reference to the Mesh. References here meaning both managed or native access to each other.

    Technically, that's true, but it's definitely not the reason why they are all in memory. So we need to address that in how we collect the connections. That's something that needs changes in the back-end (for collecting) and front-end (for crawling and displaying it correctly) of the memory profiler.
     
    Peter77 likes this.
  9. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,092
    Thanks again for rapid reply.

    I hope it's the same issue. With this issue getting fixed, it could also boost profiler performance! If there is no need to transfer and evaluate 509.117.918 connections, but only a fraction, that could be a huge performance and memory win.
     
  10. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,595
    Sorry, forgot to update this thread, the bug is fixed in 2019.3.0b9 and 2020.1.0a11 and Memory Profiler version 0.1.0-preview.8
     
unityunity