Hey Vishal,
To calculate the memory being used on a per-step basis, you can add the following to the beginning of the step:
- 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 &
Once this has been added, you can check the build log and determine the amount of memory used - please see our article below for further troubleshooting steps related to pipelines (including the above specified):https://confluence.atlassian.com/bbkb/troubleshooting-bitbucket-pipelines-1141505226.html
Cheers!
- Ben (Bitbucket Cloud Support)
Hi Ben, sorry I think I have put my question in the wrong way. I just wanted to ask when the npm run command executes for the "building the code" step how much maximum memory can be allocated to it?
Hi Vishal,
The command provided is used to debug the memory that the build step is using so you can determine how much resources are needed.
You are correct in stating that by default the memory is 2048MB maximum, using the 2x flag as you have set increases this to 4096MB, I should have clarified this in my answer - my apologies.
It looks like you're new here. Sign in or register to get started.