Container 'Build' exceeded memory limit.

Timur Aminev December 19, 2022

Hi community,

How to fix the `Container 'Build' exceeded memory limit.` issue on the Test step? The yml config:

Screenshot 2022-12-19 at 19.12.33.png

Please pay attention that no services is used.  

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 20, 2022

Hello @Timur Aminev ,

Welcome to Atlassian Community! 

The error "Container 'Build' exceeded memory limit." is returned when the commands you are executing as part of your step have exceeded the memory allocated to the build container where this step is running. Normal steps receive 4GB of memory, while large steps (size: 2x) have 8GB of available memory. This memory is shared with any services you are using in this step, so the actual value available to the Build Container might vary depending on the services you are using in the step (such as docker service, or a database, for example).

As you mentioned no services are being used (we cannot confirm from the screenshot as the pipelines definitions are collapsed), all the available memory for the step should be available for the Build container, and it seems like 8GB is not being sufficient for your tests to complete.

In such cases, I would suggest following the instruction covered in Troubleshooting Bitbucket Pipelines - Container Build exceeded memory limit to debug your pipelines and observe which process is consuming more memory.

In case you identify you need more than 8GB of memory, an alternative is to run the build in your own infrastructure by using self-hosted runners, where you can configure up to 32GB of memory (size: 8x).

Let me know in case you have any questions.

Thank you, @Timur Aminev .

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events