Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Build container running out of memory due to docker service


I am trying to add the docker service to a bitbucket pipeline step. However, with the default memory allocation of 1gb, this service takes away too much space from the Build container, which runs out of memory (for whatever reason, this only happens sometimes). Reducing the docker service size to 512 mb mitigates the issue, but causes other pipeline steps which rely on docker to fail due to the docker service container exceeding memory.

My understanding is that it is currently impossible to specify the memory for a service on a step-by-step basis. Nonetheless, I was hoping that somebody here might be able to offer a workaround.

The pipeline step under question runs ./gradlew clean build --parallel and has 2x memory allocated (so 8 gb). And org.gradle.jvmargs in is 

-Xmx3g -XX:MetaspaceSize=100m -XX:MaxPermSize=1g -Duser.language=en

When I run gradle with --parallel locally, it appears to spawn multiple java processes, so I am suspecting that the same happens in the build container and causes it to hog so much memory. I am still confused by this, since according to the documentation the build container is only supposed to be using up 1 gb.

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket Pipelines

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

3,815 views 64 20
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you