Memory leak in editor

Hello,

I have this asset store plugin intensive project for a client and it seems one of them is leaking objects, many, many objects…

At first I thought it was UNOShader because I found 150k UNOShaderData hidden objects with the profiler but I managed to clear them with an editor script and I removed the plugin since it wasn’t used anymore.

Now I’m confident I still have a huge memory leak because it’s a small scene with only a few objects (6 draw calls 13 saved by batching and 1.3k vertex), but the profiler says there are almost 3 millions objects and the scene is almost 500Mb heavy. Needless to say how laggy the editor is…

I’m wondering if there is a way to disable the HideInHierachy feature globally that so many plugins use so I can clean this mess up and get back to work…

1745956--110290--upload_2014-8-23_13-14-11.png

In case someone already had the issue, the incriminated plugins are: MeshMaker, Fracturation and Destruction, Concave Collider, SECTR and UNOShader which is already gone as I said. (I don’t mean to say they’re bad or anything but obviously something is off somewhere, and I haven’t written a line of code for that scene so it’s most probably comming from a plugin)

ps: just made a quick test, I’m down to only the main Camera on the scene and the object count is still in the same range.

1 Like

I’d doubt it’s a memory leak. Try using Object.FindObjectsOfType, with a class of , , and see what they return. If you have around 500k game objects, and they each have 6 scripts on them, then you’d expect around 3M objects. Getting a feel for what’s what, and dumping out the names of the objects might give you some insight into what’s happening. As you indicate, it’s probably some script gone wild and creating loads of redundant objects.

I’ve tried that in my first attempts, but it crashes the editor. I had plenty RAM available and CPU was far from busy but it just hanged there, after a few minutes I had to kill it.

It’s too bad if there’s no other way the find the hidden objects, I guess we won’t know where the object leak came from (if you like the name better ;))

Hmm. Guess mining out the data is creating too much data. :frowning: If you quit from the editor, and then re-open the project, do you start off with that number of objects, or does it slowly increase over time? If you create a standalone and profile that, do you get the same increase in objects? Based on zero data, other than the plugin names, I’d guess it was the fracturation that was creating large numbers of objects.

The scene file was very big, 500MB (yes Bytes I had it wrong in my initial post) and the scene loading felt like moving a dead cow, saving took a while too, and there were the 3M object from the begining. No increasing over time, the 3M objects seemed to be saved in the scene file.

You’re probably right with pointing the fracturation, the screenshot says there are 500k mesh, it’s 500 times more than the amount of vertex there was in the scene so… lol… I guess.

I haven’t tried building it I had to move on since this already put me out of schedule. Hope we don’t face it again but at least I’ll see it comming earlier now that I faced it at it’s climax.

Had a somewhat related issue. Couldn’t find any gameObject called ‘UNOShaderData’ in project or in scene hierarchy.

However, managed to open my scene file via Notepad++ and found it there.

I’ve ctrl+F for ‘UNOShaderData’ and deleted it from that file.

For anyone having a similar issue with some other components, do what i wrote above. Once you identify the block of text that represents the problematic GameObject, look under its ‘m_Component’. Make sure to remove blocks that represent such components as well.

On the picture you have to remove everything that’s red. The green are its ‘components’ (one transform, one monobehavior) that I was talking about. You should delete them from this file.

As a side note, you might wish to do a ctrl+F for the ids of such components as well, just to ensure they are not referenced from anywhere else in this scene. Hopefully they are not, but if they are, you will have to decide what to do with those objects that reference this sht.