I come across to the problem where memory’s growing and growing after switching back and forth between scenes.
Say I have mainmenu and gameplay scene. I tested it by switching back and forth in which each scene has their own things to load. This test leads me to several fixes for all (hopefully) game objects to be released.
Starts from mainmenu, I have 10\ MB\ in\ memory\ usage,\ then\ switched\ to\ gameplay\ the\ memory\ usage\ goes\ to40. Now I switched back to mainmenu, it’s \~20 MB. So there’s around 10 MB incurred to memory usage. I checked everywhere and can’t find a clue of what else needs to be taken care of.
At this point, I would like to ask
- How to properly clear the memory when switching scene? What’s your practical solution that works in your project, I would like to know that if you want to share.