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,368,128
Community Members
 
Community Events
168
Community Groups

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

1 vote
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

Atlassian Community Events