Assistance with HIgh memory Usage & Light Building

Hi,

I seem to be having issues with my project on UE4 using high volumes of memory and static foliage mesh lighting when I try and build lighting, I have attached my project full Memory Report I have a feelinging that some of the foliage (Trees in particular) are causing issues any chance someone could help me pin point the issues would be very much appreciated.

Hi KYE,

The memreport isn’t the best option here to see what’s going on with light builds.

If you’re light build has finished take a look at the following:

If you’re wanting to look at the logs for SwarmAgent the following are useful:

When working with any static lighting and large scenes there are some optimizations that you need to consider, mostly listed above in the links, for lightmap resolutions and what casts static shadows.

For larger scenes with foliage the lighting calculations can be long depending on the number of instances of foliage used, whether they are casting static shadows, and their lightmap resolution, along with hardware being a determining factor as well since the number of CPU cores and available RAM play a large role in Lightmass calculations with Swarm Agent.

Also some other things to consider for your scene and memory usage is the number of visible actors on screen, occlusion/visibility culling, and general optimizations to reduce the number of draw-calls that are needed.

I hope this helps.

Tim

1 Like

The memory report was help to see what was causing high memory usage when using the editor, not light building or anything like that. The editor for my project uses in average 6 - 9Gig of memory and i’m wondering what is causing it.

So my foliage culling is around 4000 - 40000 so I still have trees in the distance of the players visible reach, I am using the foliage tool and it needs to be a thick forest like scene with bushes, rocks and trees, so is it some of the foliage meshes that is causing issues so you think?

O I se what you mean now,

Foliage Tool Lightmap Resolutions
When using the foliage tool you have a few different settings available to you in the tools panel for the selected actor. One important one is the option to override the Lightmap Resolution of the mesh.

Where some of the original mesh values are at like 24 or 64

Right, didn’t mean to sound like memreport wasn’t useful, just not necessarily when trying to track down build time for lighting issues. :slight_smile:

The foliage tool definitely defaults to the static meshes lightmap resolution when if not enabled. If you’re planning on having the trees or any other foliage sway with the wind or move I would just disable static lighting for these all together, especially for grass where you shouldn’t need to worry about that many small meshes having lighting calculated for them. They should use the landscapes lightmap’s indirect lighting cache to help light in indirectly lit areas and still receive shadow casting for directly lit areas.

In general, foliage can populate a lot of instances very quickly and keeping these individual foliage instances in check with what they really need enabled can help get you the better light build times. Using the Statistics window can help you quickly identify what is taking the longest in the build process to see why. Also make good use of Lightmass Importance volumes, otherwise the entire scenes bounding box will be used rather than having the higher quality of the lightmass importance volumes in only the areas where the player can access.

Yeah thank you, I have Light Importance Volumes, but i’m only using them around buildings and areas that I consider need to look really nice when the placer is withing its view, is this right (Like buildings and courtyards and areas of towns and so on not forests

Typically the importance volumes would be used for anywhere the player can access since you want nicer baked shadowing for these areas. Anything out of them gets lower quality shadowing priority and reduced number of bounces for the indirect lighting, but if that’s your goal to have lower quality in these areas and you’re happy with the baked results, I think it’s ok to do this. If these are areas that the player can never access keep the lightmap resolutions super low since they won’t matter to the player being able to get to them.

Ok thank you for your assistance ill make some modifications and see how I go, just one more thing, don’t know if i will have to open a new question for this but; Texture streaming I have to up the pool every time to around 3000 is that ok to do that and if so haw do I set that in the ini and what ini do I set it in?

Sorry for the delayed response.

This page should help if you’ve not seen it: Texture Streaming in Unreal Engine | Unreal Engine 5.1 Documentation

The .ini settings you’ll need are called out in the next section after this one. I didn’t see it in the documentation, but the .ini file you need to adjust these settings in is the BaseEngine.ini or DefaultEngine.ini if you’ve set up a project specific one in your project folder.

With a streaming pool of around 3000 you’re looking at 3GB of memory usage. Depending on the hardware you’re targeting this may be too much. Hopefully the docs above can help you reign in the settings and optimizations you need.