- Home /
What is the correct way to unload a resource and free the memory it occupies?
Hi all,
Recently i'm coding the resource manager which handles loading and unloading the assets for my C# project, first thing that comes to my mind is about the memory usage of those assets, that i want to make sure they get freed at the appropriate time.
i searched online for experiences, well it seems the most natural way to make sure of this is that you take charge of removing all related references and GC handles it.
Looks fine to me but i'm also aware of functions like "Resources.UnloadAsset", checked the docs but still not sure what they really do to unload a resource immediately, and when should we use it or it's unnecessary if i managed the GC references well? and do functions like this have any performance issues?
Much appreciated.
Comment
Your answer