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:
- why is garbage collection during a delete taking so long compared to an enforced garbage collection before the delete?
- 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