---
name: codeengine-ts-build-fail-memorylimit
title: Build fails when the memory limit is exceeded
description: After you create and run a build, your build does not complete successfully and you receive a message that the memory limit is exceeded.
last-updated: 2023-11-08
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/codeengine?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

# Build fails when the memory limit is exceeded
{: #ts-build-memory-limit}
{: troubleshoot}

After you create and run a build, your build does not complete successfully and you receive a message that the memory limit is exceeded.
{: tsSymptoms} 

If you receive a message that the memory limit is exceeded, then your build size is too small.
{: tsCauses}

When a build runs, it is running steps, which include code compilations or container image packaging. These steps require memory. Depending on whether you choose a `small`, `medium`, `large`, `xlarge`, or `xxlarge` size for your build, a maximum amount of ephemeral storage is available to a build run. For more information about build size, see [Determine the size of the build](https://cloud.ibm.com/docs/codeengine?topic=codeengine-plan-build&format=markdown#build-size). When the maximum memory is reached, the build run is stopped with an error message; for example,

Example error message 

```txt
Summary: Failed
Reason:  OOMKilled
```
{: screen}

Try one of these solutions.
{: tsResolve}

Whether you are running your build in the console or in the CLI, use the CLI for troubleshooting problems with your build.
1. Run the `ibmcloud ce buildrun get --name BUILDRUN_NAME` command to display the details of your build run.
2. Review the `Reason` in the command output.
{: note}  

To resolve this problem, use a larger size for the build. 

A larger build size also means that more memory and CPU cores are assigned to the build runs. Increasing this size will probably speed up the build runs, but also increases their cost.
{: important}

For more information about build sizes, see [Determining build sizes](https://cloud.ibm.com/docs/codeengine?topic=codeengine-plan-build&format=markdown#build-size).

1. Use the [**`ibmcloud ce build update`**](https://cloud.ibm.com/docs/codeengine?topic=codeengine-cli&format=markdown#cli-build-update) command to update the build configuration to use a larger size; for example,

    ```txt
    ibmcloud ce build update --name <BUILD_NAME> --size <SIZE>
    ```
    {: pre}

2. Use the [**`ibmcloud ce buildrun submit`**](https://cloud.ibm.com/docs/codeengine?topic=codeengine-cli&format=markdown#cli-buildrun-submit) command to submit a new build run. For the **`buildrun submit`** command, you must specify the `--build` option to provide the name of your build configuration. You can optionally specify the `--name` option to provide the name for this build run. If you specify the `--name` option, make sure that you use a different build run name from the failed build run, or ensure that you delete the failed build run by using the [**`ibmcloud ce buildrun delete`**](https://cloud.ibm.com/docs/codeengine?topic=codeengine-cli&format=markdown#cli-buildrun-delete) command. For example,

    ```txt
    ibmcloud ce buildrun submit --build <BUILD_NAME> --name <BUILDRUN_NAME>
    ```
    {: pre}