Stall when deleting Actor from world map after loading region of World Partition

We have a large world map containing many actors, and are using World Partition. If I load a small region of the map, select an actor, then delete it, the Editor typically stalls for about 8 seconds. The attached screenshot shows what appears in the utrace during this delete. About 5 seconds of the time (red box) is caused by garbage collection upon deleting the actor. This only occurs on the first delete after loading the region.

If instead I enforce garbage collection via the ‘obj gc’ command straight after loading the region, then the first delete is 5 seconds quicker and the area in the red box of the utrace no longer appears. I also note that the enforced garbage collection takes about 250ms, so much faster than during the delete.

My questions are:

  1. why is garbage collection during a delete taking so long compared to an enforced garbage collection before the delete?
  2. what would be best practice for automating an enforced garbage collection after loading a region of world partition, in Editor-time only (a suggestion I’ve had is to create an editor-type plugin which registers to, say, OnLevelStreamingStateChanged, and perform an incremental garbage collection)?

Thanks

Steps to Reproduce

  1. In Editor, load map that contains many actors
  2. In World Partition tab, select a small region of the map, right-click, and select ‘Load Region From Selection’
  3. In the viewport, select one of the actors that was loaded and press Delete
  4. Observe that the Editor stalls while the actor is being deleted

Hi Andy,

It looks like the transaction generated for the Delete operation (undo) is getting bloated by unrelated UObjects left over by the manipulation of the regions. That would explain why running the GC before deleting the actor is making a difference.

There is currently no hook that you can use to trigger the GC after manipulating regions. I created a feature request so this is automatically handled by the WP systems.

Thanks for the report.

Martin