Description

When a Level is being removed from world (UWorld::RemoveFromWorld), the time slicing (time limit) is not respected especially if the EndPlay of actors takes some time.

  • Before starting the RouteEndPlay, check the time limit and early-out
  • Evaluate if we can introduce time-slicing in the loop that calls EndPlay on all actors (without any side effects).
  • If considered dangerous, this could be enabled using a CVar (disabled by default)
  • Also check the time limit before doing the last part (post-RouteEndPlay). This time, no time slicing should be necessary for that last pass.
Steps to Reproduce
  • Create a Level
  • Add BP Actors with EndPlay logic that takes a lot of time
  • Play the game
  • Run UnrealInsights and profile the game
  • Look at the time taken by RemoveFromWorld
    Result: Time limit per frame allowed for Level Removal is not respected
    Expected: Time limit should be respected (close enough)

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-239912 in the post.

0
Login to Vote

Unresolved
CreatedJan 24, 2025
UpdatedJan 24, 2025
View Jira Issue