Short screen freezes each 60 seconds since I start playing

Isn’t that the timer where the UE cleares all remaining Pointers etc?
Do you have alot of actors that could be cleared by it? Because that is happening every 60 sec as far as i know.

Hi, what I’m going to explain has only happens to me (as far as I can remember) in one particular UE4 project I’m working on, not in samples or other projects.

From the time the game starts, no matter it’s in PIE, Standalone or Packaged it seems that a hidden counter starts: every 1 minute / 60 seconds the screen will freeze for less than a second. Here is what I understand as screen freeze: for that small period the screen shows no update or game changes, but after that it comes to show what you would see if there hadn’t been a screen freeze (so it’s like a bit of an abrupt jump in time), so the game processing is not stopped, the music isn’t paused, but the screen freezes very briefly.

I have an Nvidia Geforce GTX 770 so I don’t expect it to be a graphics card issue, my processor though does a bit of bottlenecking in some games at high settings. If I were to think particularities of the project (to see if someone knows that any of them can lead to screen freeze in one way or another): there’s a big landscape, characters and other actors with Apex clothing, some assets from Content Examples, VehicleGame and Elemental Demo, some actors are spawned (but without a 1 minute periodicity nor any fixed frequence, in no case new actors are spawned every 60 seconds).

With that said, do you know what might be causing the brief screen freezes exactly every minute?

I’ve noticed the same issue and for me it seems to be related to the amount of AI actors I’ve got moving about in the level. It’s barely noticeable with less of them, but as soon as I scale it up it goes from doing 30ms per frame to taking 400+ms for that one frame.

Hi eXi, let’s see if I’m understanding that: do you mean that each 60 seconds the engine clears all references in the game world related to actors that have been destroyed within that 60 seconds?

I think that about 150-200 actors (of 3-5 different Blueprint classes) are destroyed in the game during a minute. Could that be causing a very slow pointer-clearing that produces the screen freeze?

Hi, Bohrium, in my case there are no AI actors there, so I would say AI actors are not the cause of our screen freeze issue (but maybe the amount of actors in general), and I can’t say if in my case the freeze is more long / noticeable each time as circumstances in the game don’t change much.

I think that possibly yes, I’ve talked with another user, Tawre, who says it’s very likely a garbage collector issue that can be avoided if I reuse or recycle the actors instead of destroying them. I’m going to try that now, I will tell you more soon.

Yes thats what i meant.
I learned about the 60sec when i had an array of itemobjects which i destroyed after saving them in the array. After 60sec the references were destroyed too and my inventoryarray was empty.
I don’t know if this can cause lags if too many “garbage” is cleared at once.

OK, I’ve setp up things in the game so the actors get reused and not destroyed, but there’s still going on a screen freeze every 60 seconds!

What could be causing it?

Any ideas? I’m a bit stuck with this.

OK, here is how it’s been solved:

I am having some issues related to this too.

I found out what was causing this for me.
Apparently AIMoveTo is a little janky. https://answers.unrealengine.com/questions/83604/lag-after-in-game-accumulates-in-average-10-000-ob.html

I replaced any and all instances of that function with just a “move to” on the ai controller and it runs like butter.

Epic, sup with that?

Thanks for the information, although I’m not using AIMoveTo in my project by now, so it possibly has another cause here.