Best way to deal with Lighting Build running out of memory?

Hi Guys,

I’ve done a few small architectural scenes very successfully.

I’m doing a larger project as a demonstration, see if I can get some paid work :slight_smile:

However, given it’s a larger scene, I’ve chose to split up some walls into different objects so I can get a decent resolution out of my light maps.

Unfortunately, even with a couple of objects @ 1024 for the light map resolution, my light build is crashing. I can’t get the build completed with it over 512.

Is there a way to mitigate this problem? Im trying to get the best quality I can on the floors and walls.

It’s a pretty low-poly scene and I’m confused given that there’s a lot of projects out there that are much larger & would surely require more memory than mine.

CPU is a 980x with 20gb ram.

Tried using swarm but can’t even get it to work yet :slight_smile:

Are you sure you’re running out of memory? I’ve got scenes using more assets than that and it doesn’t use nearly that much memory

1K Is hella-high for lightmaps on simple walls like that. Also, I’m fairly sure the running out of memory bug was fixed in Lightmass many releases ago when lots of people couldn’t build lighting for the Landscape world… what version of UE4 are you using?

Yeah, that’s whats confusing me. It’s definitely running out of memory. See attachment.

Im trying to get some decent shadows. I dont think it’s that high given that each wall object object has about 100m2 of flat surface. Correct me if I’m wrong. Using 4.6.1…

On another note, it takes longer to crash when I turn the direct light & enviornment light to “Stationary” as opposed to “Static”. Any difference in quality there? Given they are static, I thought static would have been the best option…?


If you have enough time, you could simply raise your pagefiles size in Windows until there is “enough memory”. Worked for me, when I did something rather stupid, and needed over 140 GB RAM for lights ;).

There must be something wrong, at 20GB it should not have memory issues with that scene, even with high resolution lightmaps.

Yeah, that’s what I’m thinking. I’ve got it to work once I just left all the walls, floors and ceiling attached.

Any idea what the problem may be?

I’ll upload the FBX if anyone is interested?

Also what I once had, I had a huge Segemt of a Spacestation. As a huge Part, it took a hell lot of RAM for light calculation (over 140 GB). When I imported it without combine Mesh, it only needed 10 GB Ram, while the now several lightmaps even had a better quality (more resolution). So maybe that is your Problem as well?
And if you want, I can test your FBX

My issue was actually the opposite… :slight_smile:

Combine mesh worked perfect, when I separated the mesh’s (attempting to get high-res lightmaps on each object) is when it started to run out of RAM & crash.

It’s still very much a learning curve for me. My previous tests were of much smaller spaces so this attempt is to now scale it up & see what issues I face with regard to quality…

FBX here: - I split up the walls, ceilings and floors and set the lightmap res to 1024 which is when it was failing.

Soo some quick testing:
Importing as single Parts: all set to 1024 Shadows, I needed 8 GB Ram
Importing with Mesh Combine: set to 4076 Shadows (to compensate for overall lower Shadowmap Resolution) → 9.2 GB Ram + very poor CPU Load for most of the part.

Also your FPX has quit a few degenerated tangents. And for most of the walls you really don’t need 1024, even if you want to have the highest possible quality. Just start out with something lower like 256 and then see, where you think more resolution could help. There might be some people here, that know more (I am also still learning most things) but if you want to stick to the high quality and you still keep running out of memory, just raise the Pagefiles size for that time (it is then used, as “additional” Ram, just very slow).

Hmm, might just be my computer then. Maybe I’ll try a reinstall.

I haven’t modelled in a long time, so what do you mean by degenerated tangents?

Its a warning Unreal 4 gave me with your FBX, when importing it. Through not quit sure what exactly it is (am also fairly new to this).

Hmm, I’ll have a suss.

Thanks for the help!

Can you confirm whether is running out of RAM or running out of Disk space memory?

UE has to use up some additional disk space in order to build the lighting, can you see how much space is left on your hard drive?

A ha!

I didn’t know the light map was using disk space, I always thought it just relied on physical memory alone. I’ve installed Unreal on an SSD and it’s running out of space. At the time of testing, I think it was in the region of 8 - 10 GB free.

How would I confirm whether it’s disk space memory or physical? It was running about 93% RAM usage, but perhaps that was as a result of running out of disk space?

Is Unreal writing an Unreal file or using windows pagefile? I was actually considering moving pagefile to a different drive for this purpose. I’ve heard some horror stories of doing this, so I want to be sure it’s a disk space issue firstly.

Somewhat related, the DerivedDataCache is killing my SSD space, is this safe to delete? Furthermore, can I move and set it to write on a different drive?

Sorry for the bombardment of questions, and appreciate your help.

You can safely delete DerivedDataCache. It will cause your shaders and navigation and stuff to rebuild next time you open your project but that’s it (even after the rebuild you will save space, UE does nor like to clean up after itself with those calculations so you may have months of old build data across many engine versions just idling in that folder). No, you can’t move it though… But it SEEMS (maybe it’s just luck of the draw) that UE is better about cleaning up after itself in 4.7, my DDC no longer balloons to some ridiculous size after a few days of work.

Hello Mate

Light build out of memory error usually is caused by 2 things : 1st troubled object’s light map so to solve this > check log report after the appearance of “out of memory” message and change light map manually to the objects with troubled light map and make it 256 for example and re-do light build // the 2nd cache folder of UE is full so clear cache from swamp

those issues caused light build “out of memory” to happen in my experience and i do light builds pretty much for projects i work on

Hey guys, I know this is an old post, but maybe it can help.

I had the same problem, UE4 crashing when I tried to build lighting (version 4.16.0-3792635+++Odin+Release / because I’m working on a mod for Robo Recall).

So, I solved this problem in a very simple way, just turning off the autosave. I realized that UE4 was crashing after the autosave was ending.