Game hangs after minute of playing

I made game for android. After about minute of playing game hang and I can’t do anything. I had the same problem with my previous game. How I can resolve this problem? I tested my previous game created on 4.5.1 on Sony Xperia SP and my current game on 4.9 on Sony Xperia Z1 Compact and Sony Xperia SP and results are the same.

Game is totally frozen. I copy game files to my phone, install it and it works one minute.

I would look at the logcat. You could also use the NVidia profiler to see if tweaking settings can prevent the lockup. I.e. like changing all the textures to 1x1.

NVIDIA PerfHUD ES

PerfHUD ES is a profiler that lets you inspect individual draw calls to find bottlenecks and performance leaks. Get started fast with the quick-start guide.

http://docs.nvidia.com/gameworks/index.html#developertools/mobile/perfhud_quickstart_guide.htm


Only last 6 lines is game logs when game freeze.

I made my games with blueprints. Always 59 seconds.

And by frozen do you mean that input no longer works? Or is the game totally frozen? Did you run out of memory with a leak? Is there anything in the logcat?

adb logcat

This sounds like garbage collection problem, does it happens exacly in 1 minute all the time? Do you used C++? If yes then you missing UPROPERTY() in one of objects varables, engine don’t see active refrence without it and considers object as unused

That does sound like a garbage collection issue. Odd to have that happen so early. Are you destroying any actors during initialization?

I am shooting static meshes like in FPS template.

If it was a crash to desktop I could blame ANR. Activity Not Responding happens after not responding to input for more than 5 seconds. This can happen if you have a loading content routine or a blocking method that does not return in less than 5 seconds.

while (true) //for more than 5 seconds
{
// boom
}

I updated my phone Sony Xperia Z1 Compact from Android KitKat 4.4.4 to Android Lollipop 5.0.2 and game doesn’t freeze. Only on Androids below 5.0.2 game freezes.