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

print bitbucket pipelines memory usage

Brian Soe November 25, 2021

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

2 votes
Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 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
AUG Leaders

Atlassian Community Events