IBM Cloud Docs
Build fails when the memory limit is exceeded

Build fails when the memory limit is exceeded

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

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

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. When the maximum memory is reached, the build run is stopped with an error message; for example,

Example error message

Summary: Failed
Reason:  OOMKilled

Try one of these solutions.

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.

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.

For more information about build sizes, see Determining build sizes.

  1. Use the ibmcloud ce build update command to update the build configuration to use a larger size; for example,

    ibmcloud ce build update --name <BUILD_NAME> --size <SIZE>
    
  2. Use the ibmcloud ce 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 command. For example,

    ibmcloud ce buildrun submit --build <BUILD_NAME> --name <BUILDRUN_NAME>