Too much memory utilized in build!

My PC:

Details: I go to build it it works fine at first (no freezing) then all of a sudden it goes way up in memory.
I open task manager and it says “unreal lightmass” is the program that is taking up all memory.
It eventually starts at around 1-2%.