- Home /
Low FPS after loading a scene
There are two scenes, say, s1 and s2. Now s2 runs fine with full fps when it's the only scene built and loaded, but when both s1 & s2 are built, and i transit from scene s1 to s2 using Application.LoadLevel()
, there is considerable fall in fps in s2 !
Now `Application.LoadLevel()` says
'When loading a new level all game objects that have been loaded before are destroyed. ...'
Then what could be the reason for low fps in s2 ?
Answer by flamy · Dec 12, 2011 at 11:17 AM
static variables and game objects in s1
also the scene wont be released from the memory if there are static variables in it(not sure though, heard something like that).
Also Don't destroy on load variables or gameobject will be in the memory still!! one of these shd be ur problem.
Thing is ur scene one is in the memory still.... check the ram usage for both the builds u will get something!!
Thanks flamy for the input. Of all cases, only static variables can be a problem (others not used), but i don't think entire scene objects remain occupied in memory for even one static variable in one script! Actually I am already destroying all the gameobjects from scene s1 except the one holding the only script in the scene s1.
ya even i checked that it is not the entire scene that will remain in memory...
btw did u check the memory usage of the two builds? it would make a lot of things clear!
checked the mem. details, diff. is negligible enough or almost nil -- so most probably nothing stays back from s1 while we're in s2
hmm i dont knw if it will work... add a empty scene in between and load the s2 scene after some time(may be 2 or 3 secs)?!
ahh that was the first thing i did as a measure with GC.Collect() in it :) That was a relief but still did not turn out to be a complete solution
Your answer
Follow this Question
Related Questions
Loading a Random Resource in a Folder Without Using Resources.LoadAll 0 Answers
When are resources outside the resource folder in memory? 2 Answers
Long load time for scene... Some optimization questions. 1 Answer
Multiple calls of Resources.Load for the same resource 1 Answer
Best way to handle 100+ sound files 0 Answers