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.
- Run the
ibmcloud ce buildrun get --name BUILDRUN_NAMEcommand to display the details of your build run. - Review the
Reasonin 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.
-
Use the
ibmcloud ce build updatecommand to update the build configuration to use a larger size; for example,ibmcloud ce build update --name <BUILD_NAME> --size <SIZE> -
Use the
ibmcloud ce buildrun submitcommand to submit a new build run. For thebuildrun submitcommand, you must specify the--buildoption to provide the name of your build configuration. You can optionally specify the--nameoption to provide the name for this build run. If you specify the--nameoption, 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 theibmcloud ce buildrun deletecommand. For example,ibmcloud ce buildrun submit --build <BUILD_NAME> --name <BUILDRUN_NAME>