Extreme Memory Usage when Play In Editor with World Partition and Level Instances

Hello!

I’ve recently come across case where the editor in PIE will consume extreme amount of memory. We had a case recently where some level instances were converted from using ISMs to individual actors. We noticed that suddenly PIE would take up extremely large amounts of ram. This caused the editor to become unresponsive on dev machines with lower amounts of ram installed. This is an editor only problem, as the code only seems to be active in editor builds, and no issues have been experienced in a cooked client build. It appears to stem from line 728 in `WorldPartitionLevelHelper.cpp`, specifically the use of `FLinkerInstancingContext::DuplicateContext`.

I’ve added a screenshot of a memory profile capture in Insights of the attached repro project.

I also found that if a level instance level does not have world partition streaming support, there is no memory consumption.

Steps to Reproduce

  1. Create a level, named L_TestA with a large number of static mesh actors, any mesh will do (5000 - 15000 individual static mesh actors)
  2. In the Content Browser, select the level L_TestA and Add Partition Streaming support to it
  3. Create a new level, named L_TestB, and add several of the L_TestA levels to it as level instances. Also add partition streaming to this level as well.
  4. Create a new world partitioned level, add a basic landscape, and add one or more L_TestB to it as level instances
  5. Play In Editor, and notice long load time and massive memory usage

In the attached repro project, just open the project and the level L_BugRepro if doesn’t load by default, and then run PIE to see the bug.

Hi Mark,

This is a known problem that is still being worked on by the team. You can follow its evolution on the public bug tracker: Unreal Engine Issues and Bug Tracker (UE\-222013)

Regards,

Martin

You do want to use ISMs to help with the runtime performances. You can use the UWorldPartitionRuntimeCellTransformerISM to have the ISMs created automatically when the cell generation runs (PIE and Cook).

There is also FastGeo that should be considered here. It it also based on a cell transformer that converts immutable static geometry into a lighter runtime format that doesn’t depend on UObject. You get get more information about the plugin in the World Building Guide: https://dev.epicgames.com/community/learning/knowledge\-base/r6wl/unreal\-engine\-world\-building\-guide\#wp\-importantchangesin56

Martin

Yes and no, The instances that are aggregated would only have 1 actor per StaticMesh which should reduce the number of required LinkerContext

Also, using LevelInstance without OFPA should help. If your LIs contains lots of actors or are large, you could consider Sub-word partition. Those don’t allow for per instance modification out of the box but could be useful depending on the needs of the project.

Yes, you can do it from the World Settings panel. You need to disable ‘Use External Actors’ and save the level. If the level uses World Partition, it needs to be disabled as a first step.

[Image Removed][Image Removed]

Regards,

Martin

Is there a recommended workaround or mitigation? Is it to just keep everything in ISMs or use level instances that don’t have OFPA support?

In those cases, it won’t try to duplicate that linker context when trying to play in editor?

Is it possible to convert an existing level asset with OFPA to one without OFPA?