Saving unity scene uses 9gigs of memory and hangs editor for a good 30 seconds

Not sure whats happening, my scene is mostly empty.

Before, I’d had a script with a silly recursion mistake that caused a stack overflow - I was creating a hash of the version of the instance of my class for serialization (of a tree of data) by serialising the empty version of it, (tree parent), and an empty version of the tree’s subnode, and adding them together. (ofc I put “new ()”, which was in the constructor, instead of just formatting the empty instance of the the class, which lead to the stack overflow)

I’m pretty sure it was only after that that I was having issues. Any idea what might be causing the 30 second freeze on saving the scene though, and the huge increase in memory? (it goes up by about 1100mb every time I save -starts at 6.2gb, went up to 18gb eventually.)

Running Unity 2017.1 on windows 10, no issues before today.

I fixed the problem by deleting the scene and making a new one with all the same stuff in it. No idea what the problem was, but the old scene was about 20x bigger filesize than it should have been.