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

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

183 views 2 4
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