How to Use size 2x for More Memory in Bitbucket Pipelines
The size: key doubles (2x) or quadruples (4x) a step memory allocation for builds that exhaust the default budget.
Set size: 2x on a step to raise its memory. Remember the budget is shared between your build container and any attached services or docker daemon.
A larger step with a service
size: 2x raises the memory so the build and Postgres service both fit.
bitbucket-pipelines.yml
pipelines:
default:
- step:
name: Heavy build
size: 2x
services:
- postgres
script:
- npm ci && npm run build:allGotchas
- The step memory budget is shared with services and the docker daemon - bump
sizewhen you add them. - Larger sizes consume more build minutes per minute of wall-clock time.
- If a step is killed without a clear error, an out-of-memory kill is a likely cause - try
2x.
Related guides
How to Use Service Containers in Bitbucket PipelinesRun Postgres or Redis alongside a Bitbucket Pipelines step with the services key and definitions block so int…
How to Run Docker-in-Docker in Bitbucket PipelinesBuild Docker images inside Bitbucket Pipelines by enabling the docker service so docker build and docker push…