Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Is it possible to increase the memory limit assigned for the build environment?

According to the documentation:


  • The build container is given 1024 MB of the total memory, which covers your build process and some Pipelines overheads (agent container, logging, etc).

However, for the build I'm running, I seem to be hitting this limit:

2019-11-22 14_35_52-Window.png


The step should have a total of 4096MB of memory available for build + services. Is it possible to increase the memory limit for the "Build" container to e.g. 2096MB?


I know that the "size: 2x" option exists, but it seems that if the extra 3GB is available for the step anyway, why shouldn't I be able to use it for the build container?


1 answer

0 votes


If you don't run any services and don't enable the 2x option, the build container has 4 GB of memory available.
If you have services running, then the build container gets 4 GB minus the memory used by the services.

I believe that the sentence you quoted from the documentation may be referring to the minimum amount of memory required for the build container. I have reached out to the documentation team to clarify this specific part of the doc.

If you run into the "Container 'Build' exceeded memory limit" error, then I would suggest:
* in case you use services, limit the memory used by services (there are examples in the doc that you linked)
* enforce the max size of memory used in your build to be under the available memory
* use the 2x option

Please feel free to reach out if you have any further questions!

Kind regards,

Is there any way to see how much memory the build container used?

I had no other services active, so the build container should have had at least the 4GB. I worked around it by enabling the 2x option for now, but I am wondering how much memory the build was actually using.


You can add the following commands at the very beginning of the script in the bitbucket-pipelines.yml file:

- while true; do date && ps -aux && sleep 15 && echo ""; done &
- while true; do echo "Memory usage in megabytes:" && echo $((`cat /sys/fs/cgroup/memory/memory.memsw.usage_in_bytes | awk '{print $1}'`/1048576)); sleep 60; done &

These commands will show memory usage (also per process) in the Build log when you run a build, this way you can see which processes need most of the memory.

Kind regards,

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...

754 views 15 10
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