Hello,
I have this highly convoluted project. Now recently I noticed, that when running it, it slowly gobbles up memory until finally either Unity or the game crashes from lack of memory.
So I used the DetectLeaks script and found out that the game creates like.. a few thousand materials per second. All called "Default-Diffuse (Instance)". I can "find" and destroy them, nothing in the game seems to change, but the memory problem is fixed, except for the performance hit of finding and destroying them in the first place.
But of course I'd rather be interested in finding out, where they come from. So, does anyone have an idea how I could find the object/script responsible for creating them?
And no, turning more and more parts of the game off will not work, as it is very entangled and one thing doesn't work without the other (hooray..). Please share your brilliant insights!