Memory Leak in Selection.GetFiltered() with SelectionMode.DeepAssets ?

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. :wink:

Is there something I’m forgetting? I tried some GC.Collect calls, but no dice. Time for a bug report?

Sure. I recommend to make some robot and sent that report at least 5x a day. Maybe after month or two they will inform you about putting this between issues :slight_smile:

Created the email bot, let’s hope for the best.

Good job.

I think a full page ad with the bug report in NY Times would do a better job, but this is cheaper.