A lot of memory taken by meshes

In the Unity Profiler, it says my meshes are taking over 200 mb memory. Thing is, I don’t have meshes in my scene. The only place they exist is in my list. Would that be it? Do prefabs on a list take memory?

I tried clearing the list, turning it to null, doing = new List. Yet they still exist in the profiler. My list derives from another class, which is serializable if that matters. Like List();

I hope I can get some help!

• Why are you storing meshes in a list if you don't want them in memory? Presumably they're in that list because you need them to perform some action you want in your game, no? Jan 5, 2019 at 14:34
• Note that they won’t be deleted immediately after setting the list to null, and so they will continue to take up memory. You can unload them manually using Resources.Unload on each one before emptying the list, or using Resources.UnloadUnusedAssets to clean up everything at once after emptying the list. Jan 5, 2019 at 16:28
• @DMGregory I forgot to mention that I pick one random prefab from the list and instantiate at Start. That is it yeah Jan 5, 2019 at 16:33
• @EdMarty Mind writing an answer? Jan 5, 2019 at 16:33

Alternatively, if you don’t mind taking up large amounts of memory on scene load and clear it up after picking one, you can just instantiate the one you want from your list, then unload all the other ones using Resources.UnloadAsset. Note that you should not call this on the instantiated mesh, as it may remove the one used in the scene.
You can also try using Resources.UnloadUnusedAssets after emptying the list, although that may take some time to look through the entire GameObject hierarchy.