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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.