Running out of memory while building HLODs (64 GB Ram, 3070ti)

I’m building HLODs for my level and running out of memory. I’m not sure if it’s VRAM or RAM that is running out, but either way, it really shouldn’t be, as I’ve got a 3070ti and 64 GB of RAM.

This is while using a mesh approximation HLOD generation method, and basically the same settings as the City Sample HLOD generation.

Strangely, this only happens when generating HLOD1. All the HLOD0 actors are generated just fine, but as soon as the first HLOD1 starts getting generated, the issue appears.

The end of the log reads:

[2022.09.03-02.11.32:218][  0]LogMemory: Platform Memory Stats for WindowsEditor
[2022.09.03-02.11.32:218][  0]LogMemory: Process Physical Memory: 5441.98 MB used, 56792.32 MB peak
[2022.09.03-02.11.32:218][  0]LogThreadingWindows: Error: Runnable thread Background Worker #15 crashed.
[2022.09.03-02.11.32:218][  0]LogMemory: Process Virtual Memory: 248503.72 MB used, 248505.41 MB peak
[2022.09.03-02.11.32:218][  0]LogMemory: Physical Memory: 47105.00 MB used,  18351.69 MB free, 65456.69 MB total
[2022.09.03-02.11.32:218][  0]LogMemory: Virtual Memory: 261030.95 MB used,  1033.73 MB free, 262064.69 MB total
[2022.09.03-02.11.32:218][  0]LogWindows: Error: === Critical error: ===
[2022.09.03-02.11.32:218][  0]LogWindows: Error: 
[2022.09.03-02.11.32:219][  0]LogWindows: Error: Fatal error: [File:C:\UE5\5.0\Engine\Source\Runtime\Core\Private\GenericPlatform\GenericPlatformMemory.cpp] [Line: 221] 
[2022.09.03-02.11.32:219][  0]LogWindows: Error: Ran out of memory allocating 12288 bytes with alignment 16. Last error msg: The paging file is too small for this operation to complete..
[2022.09.03-02.11.32:219][  0]LogWindows: Error: 
[2022.09.03-02.11.32:219][  0]LogWindows: Error: 
[2022.09.03-02.11.32:219][  0]LogWindows: Error: 
[2022.09.03-02.11.32:219][  0]LogWindows: Error: 
[2022.09.03-02.11.32:219][  0]LogWindows: Error: 
[2022.09.03-02.11.32:219][  0]LogWindows: Error: Crash in runnable thread Background Worker #15

Any ideas on how to avoid this?

I’m encountering the same issue as you, with identical PC specifications and error logs. Have you found a solution yet?

Here are the steps I’ve tried:

  1. Disabling “Use Landscape for Culling Invisible HLODVertices” on Landscape Proxies increased the building progress from 22% to 43% before crashing.
  2. Adjusting Voxel Accuracy for HLOD1 Approximation from 1m to 2m (with 1024 voxel resolution) led to a crash at 31%.
  3. Setting Clamp Voxel Resolution to 512 resulted in a halt at 31%.
  4. Returning Voxel Resolution to 1024, enabling Ignore Tiny Parts, and setting it to 0.05 also resulted in a halt at 31%.
  5. Adjusting Voxel Accuracy to 125m (the size of a whole World Partition cell) with 1024 voxel resolution still resulted in a halt at 31%.
  6. Removing about half of the scene actors led to a slight progress, halting at 32%.
  7. Setting Tiny Parts Multiplier to 1.0 (which should ignore all parts smaller than 125m if I understand this parameter correctly) led to a 100% success. However, only large objects like backdrop mountains were preserved in HLOD1, which should be excluded from HLOD as they are always visible.
  8. Setting Approximation Accuracy to 62.5m (half the size of the WP grid) and Tiny Parts Multiplier to 0.5 (which should only include objects larger than 31.25m) also led to a 100% success.
  9. Setting Approximation Accuracy to 25m (half the size of the WP grid) and Tiny Parts Multiplier to 0.25 (which should only include objects larger than 6.25m) resulted in a halt at 19%.

I’ll provide more updates in the coming days.

1 Like

It says what the issue is right in the log you posted.
Your system is allocating 256GB of Page File and then running out.
With a 64GB system your Page File typically will max out at 4x RAM size=256GB.
You don’t have enough memory to perform the HLOD creation on the map you have selected.

You will require a computer with much more RAM.
64GB is not very much memory, especially for Unreal Engine development.
On my R9-5950X system with 128GB I was constantly running out of memory with UE, so I built a W7-2495X workstation with 512GB of memory, that I will eventually be upgrading to 2TB.
The engine is poorly written with bloated non-optimized code that consumes massive amounts of memory.

On my workstation system with 512GB of memory and a 2TB Page File, building HLOD with nothing but a 16321x16321 Landscape in the map with a “LOD 0 Screen Size” property of 0.5 (default) or 1.0 results in 730GB of memory consumed to generate HLODs.
That gives you an idea of how badly the engine is written.
You can’t generate 730GB Commit on your system, you don’t have enough RAM.

The amount of RAM required is staggering!

I’m curious about the necessity of generating HLOD for Landscape, considering it can’t be utilized as Nanite. I attempted to bake the landscape to HLOD using the Approximate method, but the triangle count was significantly higher than when I excluded landscape tiles from the HLOD generation process. And so I am currently loading all Landscape tiles at all times.

Nevertheless, I was able to adjust the HLOD settings to build on 64GB RAM and a 512GB Page File size on a 3049x3049 map. I found that disabling Parallel Baking and the Simplify Pre Pass significantly reduced the memory requirement. I also had to lower the Voxel Resolution to 128, which is admittedly quite low.

There are numerous assets on the map that should be excluded from HLOD generation. Some of these could be dedicated to Instanced HLOD only and disappear after a certain distance (Spatially Limited HLOD Layers). However, this is now a matter of scene optimization. While this will suffice for development purposes, it appears I will need to invest in additional RAM in the near future.

The amount of RAM required is staggering!

I agree. Epic needs to do something about optimizing their code or using alternate methods that don’t put so much memory pressure on computers.

Hey everyone, I recently discovered something awesome! Try enabling Use Render LODMeshes in the Mesh Approximation section of HLOD Settings. It makes the generation of HLODs much faster and more efficient! What used to take two weeks in our project now only takes a few hours!

1 Like