I have optimized the used memory for my game now but when testing on device I still encounter a problem when there is a lot of action going on in the game. The used memory stays in a save area but it seems the actions which are done in loops to aim and fire at targets is too much with a huge enemy count and the game gets slow until it starts to lag and one time it froze and then quit automatically.
I now wonder what, besides the memory usage, can cause this kind of behavior?
I will look into the enemy wave cycle code next because I think it could be to many loops running at once or something like this. Is this possible?
I also notice the device gets hot with a lot of action going on. Can the temperature alone cause such a lag and freeze and even quit the game?