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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,554,545
Community Members
 
Community Events
184
Community Groups

can you tell me how much memory is being used by the npm run build step in this pipeline?

My pipeline has been failing due to memory limit issues for the build step. but after this setting is it working fine. I think the memory being used for docker is 2048 MB and for the Node js container is 6144 I just want to confirm this.
image: node:16.14.0
options:
docker: true
size : 2x

pipelines:
branches:
master:
- step:
name : "building the code"
services:
- docker
caches:
- node
- docker
script :
- npm i
- CI=false npm run build:production && tar czf build.tar.gz build
- pipe: atlassian/scp-deploy:1.2.1
variables:
USER:
SERVER:
LOCAL_PATH:
REMOTE_PATH:
SSH_KEY:
DEBUG: 'true'
definitions:
services:
docker:
memory: 1024

1 answer

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 18, 2022

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?

Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 18, 2022

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)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events