garbage collection in between scene changes?
I have two scenes A and B. Scene B is more memory intensive than A.
I can load scene B from A without a problem, but when I try to go back to A from B, the iPad app crashes. I think the app might have been using too much memory and iOS was forced to kill it...
Hence my question: Does Unity unload gameobjects (and free memory) from the previous scene before changing to another?
Thanks for your help!
Answer by Jean-Fabre · May 09, 2011 at 05:46 AM
then search the 'Check this answer' link in Google and get this;
New and improved link; http://unity3d.qatohost.com/questions/50562/ipad-real-memory-accumulation-how-to-prevent-this.html
Answer by Richard 3 · May 09, 2012 at 08:10 AM
I had a similar problem, even loading a blank scene started crashing my game. My problem was i had too many images in the Resources folder("which I created under assets"). The Resources folder loads everything in it into memory when the game starts. When the game was running the phone memory was getting used up by images that didn't necessarily need to be in memory all the time.
Hope this helps.
Resources from "Resource" folder included to the build even if they don't have any references in the scenes or prefabs, but they does not load in to memory until you explicitly call Resource.Load method. They are also loaded as usual assets if you have any reference on them in the scenes.