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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,809
Community Members
 
Community Events
176
Community Groups

Running out of memory in pipelines - tests pass locally w/ 8gb ram laptop

locally on a laptop with 8gb ram and a 2 core CPU, the tests pass easily.

however the tests fail on bitbucket due to out of memory. Error message is:

 

"Container 'Build' exceeded memory limit."

1 answer

0 votes

Hi @Christopher Klapperich,

Each step in a Pipelines build has 4 GB of memory available, unless you configure size: 2x, then the step will have 8 GB of memory available.

The build container is given 1024 MB of the total memory. If you are using services in a certain step, then each one gets 1024 MB memory by default, unless you have configured service memory differently in your yaml file.

If you subtract the above from the total memory of the step, you'll get the memory available for the build to run.

Could you give us some more details about this build, e.g. are you using any services in the step that fails? And are you using the size: 2x flag in that step?

You can try adding the following commands at the beginning of the script of the step that fails:

- while true; do ps -aux && sleep 30; 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 0.1; done &

These will print memory usage during the build which can be useful for understanding what processes use a lot of memory.

You can also try debugging this locally with Docker, so that you don't consume more build minutes trying to debug this:

There is an example in the above documentation, which how you can set the memory limit when debugging locally to replicate Pipelines as closely as possible (you can set either 4 GB or 8 GB if the step has size: 2x).

Please feel free to let me know if you have any questions.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events