Create
cancel
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

print bitbucket pipelines memory usage

Edited

Is there a command to print out the service / container memory, so I can see which line in my bitbucket pipeline "script:" is consuming so much memory?

When I build moderate size c++ projects with cmake or colcon, I run memory limits. I have set size: 2x and memory: 7128

I suspect that my build process is needs to be optimized for memory usage. Maybe make -j consumes too much memory?

 

1 answer

0 votes
Caroline R Atlassian Team Nov 29, 2021

Hi, @Brian Soe! Thank you for reaching out to Atlassian Community!

If you want to see memory for the build container, you can add the following commands at the beginning of the script of the step that you would like to check:

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

I hope this helps, but do let me know if you have any questions. 

Kind regards,
Caroline

Suggest an answer

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

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,481 views 4 7
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