# Exit code 137 UE5.0.3 Cooking

**URL:** <https://forums.unrealengine.com/t/exit-code-137-ue5-0-3-cooking/668860>\
**Category:** Platform & Builds\
**Tags:** Cooking, unreal-engine, UE5-0, packaging-projects, Cooking-Failed\
**Created:** [October 13, 2022, 3:48pm UTC](https://forums.unrealengine.com/t/exit-code-137-ue5-0-3-cooking/668860 "2022-10-13T15:48:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kieran.coppins](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kieran.coppins](https://forums.unrealengine.com/u/kieran.coppins)\
**Post date:** [October 13, 2022, 3:48pm UTC](https://forums.unrealengine.com/t/exit-code-137-ue5-0-3-cooking/668860/1 "2022-10-13T15:48:40Z")

</div>

When cooking I get the following error:

```auto
CommandletException: Editor terminated with exit code 137 (signal 9) while running Cook for /home/ubuntu/Azure-Agent/_work/1/s/CesiumDemo.uproject; see log /home/ubuntu/Library/Logs/Unreal Engine/LocalBuildLogs/Cook-2022.10.13-15.30.35.txt
   at AutomationTool.CommandUtils.RunCommandlet(FileReference ProjectName, String UnrealExe, String Commandlet, String Parameters, String& DestLogFile, Int32 ErrorLevel) in /home/ubuntu/UnrealEngine/Engine/Source/Programs/AutomationTool/AutomationUtils/CommandletUtils.cs:line 425
   at AutomationTool.CommandUtils.CookCommandlet(FileReference ProjectName, String UnrealExe, String[] Maps, String[] Dirs, String InternationalizationPreset, String[] CulturesToCook, String TargetPlatform, String Parameters) in /home/ubuntu/UnrealEngine/Engine/Source/Programs/AutomationTool/AutomationUtils/CommandletUtils.cs:line 91
   at AutomationScripts.Project.Cook(ProjectParams Params) in /home/ubuntu/UnrealEngine/Engine/Source/Programs/AutomationTool/Scripts/CookCommand.Automation.cs:line 268Wrapped by AutomationException: Cook failed.
   at AutomationScripts.Project.Cook(ProjectParams Params) in /home/ubuntu/UnrealEngine/Engine/Source/Programs/AutomationTool/Scripts/CookCommand.Automation.cs:line 284
   at BuildCookRun.DoBuildCookRun(ProjectParams Params) in /home/ubuntu/UnrealEngine/Engine/Source/Programs/AutomationTool/Scripts/BuildCookRun.Automation.cs:line 206
   at BuildCookRun.ExecuteBuild() in /home/ubuntu/UnrealEngine/Engine/Source/Programs/AutomationTool/Scripts/BuildCookRun.Automation.cs:line 41
   at AutomationTool.BuildCommand.Execute() in /home/ubuntu/UnrealEngine/Engine/Source/Programs/AutomationTool/AutomationUtils/BuildCommand.cs:line 344
   at AutomationTool.Automation.Execute(List`1 CommandsToExecute, Dictionary`2 Commands) in /home/ubuntu/UnrealEngine/Engine/Source/Programs/AutomationTool/AutomationUtils/Automation.cs:line 254
   at AutomationTool.Automation.Process(ParsedCommandLine AutomationToolCommandLine, StartupTraceListener StartupListener, HashSet`1 ScriptModuleAssemblies) in /home/ubuntu/UnrealEngine/Engine/Source/Programs/AutomationTool/AutomationUtils/Automation.cs:line 153

```

After some research exit code 137 tells me that its an out of memory error. I have the packaging process running on an AWS EC2 instance with 16gb of RAM. I tried applying the process to a CGroup where I limited the RAM to some arbituary number (12GB) to ensure I wouldn’t go over the maximum.

This works, as I monitor the RAM usage using `watch -n 1 free -m` it shows me that I have excess RAM. However, this line inside the log tells me it is still trying to access 16GB of RAM.

```auto
LogInit: - Physical RAM available (not considering process quota): 16 GB (15732 MB, 16110168 KB, 16496812032 bytes)

```

This tells me that I need to limit the memory allocation inside unreal itself. I’ve searched the following answers that haven’t seemed to fix anything:

- Set r.MemoryLimiter [[source](https://forums.unrealengine.com/t/limiting-ue4-ram-usage/337304/11)]
- MaxMemoryAllowance in BaseEditor.ini (Cannot find reference to this value in any ini config file) [[source](https://forums.unrealengine.com/t/how-to-customize-max-memory-allowance-for-cooking/387483)]

I can’t seem to find any documentation on config files and allocating a set amount of RAM. Does anyone know where I can set these values?

---

<div class="post-metadata">

**Author:** ![BigBrownBear](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BigBrownBear](https://forums.unrealengine.com/u/BigBrownBear)\
**Post date:** [February 9, 2024, 2:38pm UTC](https://forums.unrealengine.com/t/exit-code-137-ue5-0-3-cooking/668860/2 "2024-02-09T14:38:57Z")

</div>

Managed to solve this?
