thomasahle / TrinityProject

A mindblowing trainbased game for entire family
http://thomasahle.github.com/TrinityProject/
GNU General Public License v3.0
8 stars 3 forks source link

Investigate android crashes #52

Open MattPellegrini opened 12 years ago

MattPellegrini commented 12 years ago

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...

thomasahle commented 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.

EdShaw commented 12 years ago

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.

thomasahle commented 12 years ago

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