Changing UBT config to limit max CPUs

Hey Guys

I would like to know if there is an option, or line of code I can edit, to limit the amount of CPU cores it uses to build the project. I only have 8 Gig RAM and run out of RAM during compilation, thus the build fails. I have to build it multiple times in order to complete the build process, each times it builds a little bit at a time.

I have limited the CPUs in Visual Studio, but I know UBT builds the source on it’s own, so that’s probably why it didn’t work.

Any advice ? Except for buying more RAM :slight_smile:

Hi,

You can try tweak:

/// <summary>
/// Processor count multiplier for local execution. Can be below 1 to reserve CPU for other tasks.
/// </summary>
[XmlConfig]
public static double ProcessorCountMultiplier;

// When using the local executor (not XGE), run a single action on each CPU core.  Note that you can set this to a larger value
// to get slightly faster build times in many cases, but your computer's responsiveness during compiling may be much worse.
ProcessorCountMultiplier = 1.0;

BuildConfiguration.cs

Regards

Pierdek

Nope, didnt work. Thanks for the help though.

Ahhh, awesome thanks, that worked !!

Ok, find

 \Engine\Source\Programs\UnrealBuildTool\System\LocalExecutor.cs

then find this line of code:

if (Utils.IsRunningOnMono)

and before this line put MaxActionsToExecuteInParallel = 2; or something

With latest master (4.6, didn’t make it to 4.5) there’s an option.
Add MaxProcessorCount tag to Engine/Saved/UnrealBuildTool/BuildConfiguration.xml. Something like this:

<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
  <BuildConfiguration>
    <MaxProcessorCount>2</MaxProcessorCount>
  </BuildConfiguration>
</Configuration>

huh six month of waiting;)