occasional lag on android

When I load my project on android, after a few minutes there’s a really long ~30 second lag, seems like the game froze, and then it goes back to normal, any idea what causes this? What’s going on in those 30 seconds?

I’m making a game where a character is running across a collapsing bridge so a lag like that could be a game breaker

I don’t develop for mobile since some years ago, but if you see random lag spikes and you’re creating/deleting actors often, the lag is often caused by garbage collector on platform limitations. On mobile, instead of loading/destroying actors often you should implement an ‘object pool’ where you load needed actors once and instead of destroying the actor you hide and move back to the pool, spawning it again when needed. That way you keep the object in memory until qnother level is loaded and such freezes caused by gc won’t happen.

Try limit loading levels because level streaming on mobile has huge impact on performance.