This is a quirky bug that I ran across today and was hoping that someone might have a clue as to where I should start troubleshooting. Prior to this bug, I had the Visual Studio IDE open and was cruising along. I had made some very minor changes to some MonoBehavior classes (i.e. adding a public property and adding newly created animation events’ methods for two animations I had just added the events to). When I went back to the Unity editor, waited for it to re-compile, and then launched the game/player from within the editor…something odd happened. It just kept loading and at first I thought it was going to crash, but then after about 30-40 seconds I decided to look at the task manager… the Unity editor was consuming close to 20GB of memory…and it was still growing…
I killed the Unity editor from the task manager and wondered over to the log files to see if I saw something telling…and noticed it appeared to be recursively loading the scene assets over and over and over again.
So, to make sure, I reloaded Unity with the same scene, started visual studio and attached to the Unity editor, and then placed some break points in several of my classes (MonoBehavior derived) at the Start method… and sure enough…it would call the Start method for each asset as if it was loading the scene normally and then it would repeat itself as if it was re-loading the same scene again… and repeat itself again…and so on…
So far, I have no code that does scene loading or the like… just a single scene and the assets…which a scene loading bug or the like is out of the question.
I tried clearing out the cache files and all of the typical things… I actually even tried to upgrade to 2020 but that presented a whole new set of issues that I am not ready to deal with and would like to finish up what I have currently.
What I am currently running is 2019.4.4f1 and have the URP package installed. I know for a fact my code base isn’t forcing this reloading of assets… so my question is:
What is a good place to start troubleshooting what might be corrupt and/or what could cause the editor to just continually reload the same GameObjects (that only have one instance in the scene) recursively?
I noticed from the documentation I can get the debug symbols to debug the editor… would this be a good place to start and if so is there a suggested “entry point” I should start from to see what the heck is causing this bug/issue? It is just kind of mind boggling because the changes I made prior to this behavior were very minor (the only thing I can guess is the Animation Events and associated callbacks I added but I have done that many times in the past few weeks and never ran across this)…I do have all of my assets backed up, but even restoring them, re-importing them, etc. the problem still persists…very quirky.
Anyone else run into this and if so any suggestions are welcome.