Open MattPellegrini opened 12 years ago
There is a lot of optimization we can do. This is another place where we just tried to get done asap. We need to run a memory analyzer, like: http://www.eclipse.org/mat/ And a cpu profiler: http://www.eclipse.org/articles/Article-TPTP-Profiling-Tool/tptpProfilingArticle.html If we start optimizing without them, we'll waste lots of time for probably no good.
One of the problems was we kept creating lots and lots of new images every frame. I suspect this might be eating up memory faster than Dalvik can Garbage Collect.
Another possible low hanging fruit we can target is to not have multiple scenes in memory at once. Although we're careful to detach scenes, they can't be garbage collected as they're permanently referenced by the main class.
I agree there are lots of suspects in this game, but we really should use an analyzer if we don't want to waste time and clough up our code unnecessarily
This issue needs to be more specific. If the issue is memory, how can we avoid this? The onDetatch method for levelScene seems to do everything it needs... Investigate...