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

Build container running out of memory due to docker service

Leo Gladkov June 28, 2021

Hello,

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 gradle.properties is 

-Xmx3g -XX:MetaspaceSize=100m -XX:MaxPermSize=1g -Duser.country=US -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
TAGS
AUG Leaders

Atlassian Community Events