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

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 ░ ▒ ▓ █ Heap Explorer - Memory Profiler, Debugger and Analyzer for Unity page-2#post-3619123

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

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.

1 Like

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

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). :slight_smile:

Have you heard back from them yet?

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. :confused:

From our reply to that bug, for the public record :wink:

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!

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.

1 Like

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]( ░ ▒ ▓ █ Heap Explorer - Memory Profiler, Debugger and Analyzer for Unity page-2#post-3619123), but only a fraction, that could be a huge performance and memory win.

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