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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.