I’ve been tracking down a memory leak that was killing the editor while parsing through large selections of files, and I ended up at the following line of code:
Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.Assets | SelectionMode.DeepAssets);
After playing around with it, it seems SelectionMode.DeepAssets is the culprit. Even for relatively small selections this can add whole megabytes of memory each time it is called, and you don’t ever get that memory back. Troubling, since I’m building an easy to use batch-processor.
Is there something I’m forgetting? I tried some GC.Collect calls, but no dice. Time for a bug report?