I’ve had trying to find out where some Int32[ ] and Vector3[ ] arrays are being created. (7.9mb and 4.6mb)
They all linked to a set of gameobjects all named the same and were instanced prefabs. I deleted all of them from the scene (as I was sure they had lots of cached data we weren’t using atm) and re-ran the profile (on iOS device) and the memory remained the same but moved over to a new gameobject.
Hello,
This might be a bug or at least a bit of a weird understanding of relatedness on the part of the MemoryProfiler.
Can you please check if there is any chain of references that leads from one of these arrays to the GameObject that supposedly owns it? I.e. go through the items in you see when clicking on the Ref Count number for one of these arrays, and then recursively through all the references to these references and so forth?
The objects it was attributing the arrays to was actually an inactive object that we didn’t need in the scene so I removed them all and when I profiler again it moved it to another random object.
I can’t find any reference to this array except for what’s inside the Mud script. I’ve since changed the int[ ] to ushort[ ] because my intention was to save memory but the attribution to a random object still exists.
You can see below nothing actually links to it. The mud script is attached to an object in the scene and is never accessed by anything and the prefab that contains the game object Dest_Car_Dashboard_LOD1 has no scripts attached to it.
Is there any relation between the MeshCollider on the Mud Object and the Car Object? E.g. are they colliding while you take the snapshot? do they somehow share the mesh or a material?
Yes this was my first assumption as well but we’ve found an issue in the crawler where we parse the association to native objects. If this issue is originating from that faulty code, this should be fixed in the next package update
It seems the bug survived. I’m using the latest version 0.1.0-preview-6 and it seems shows weird relations between objects. In the attached gif you may see that enormous number of objects are related to a ‘Headlight’ object which in fact is a simple GameObject with a SpriteRenderer on it.