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,456,257
Community Members
 
Community Events
176
Community Groups

Container 'Build' exceeded memory limit. Android

Hi,
I'd like to ask you about my memory overflow problem.
I tried something but it didn't help. Sometimes it passes and sometimes it doesn't. This is a mystery to me.
Can you please give me some advice?
currently my repository size is 2.11 GB is it can matter for pipeline?
Thank you very much.


image
: androidsdk/android-30
definitions:
services:
docker:
memory: 512
docker-with-more-memory:
memory: 2048
type: docker
docker-with-large-memory:
memory: 5120
type: docker
pipelines:
branches:
master:
#- parallel:
- step:
size: 2x
name: Build
caches:
- gradle
script:
- echo "$GOOGLE_SERVICES_JSON" | base64 -di > app/google-services.json
- echo "$SIGNING_JKS_FILE" | base64 -di > android-signing-keystore.jks
- ./gradlew assembleRelease
artifacts:
- app/build/outputs/**
- step:
size: 2x
name: Build Debug
caches:
- gradle
script:
- echo "$GOOGLE_SERVICES_JSON" | base64 -di > app/google-services.json
- echo "$SIGNING_JKS_FILE" | base64 -di > android-signing-keystore.jks
- ./gradlew assembleDebug
artifacts:
- app/build/outputs/**
- step:
size: 2x
name: Test
caches:
- gradle
script:
- ./gradlew test
- step:
size: 2x
name: Push On Production
#trigger: manual
script:
- echo "$GOOGLE_SERVICES_JSON" | base64 -di > app/google-services.json
- echo $GOOGLE_API_KEY_JSON | base64 -di > google_play_api_key.json
- echo "$SIGNING_JKS_FILE" | base64 -di > android-signing-keystore.jks
- ./gradlew :app:publishReleaseBundle
artifacts:
- app/build/outputs/

1 answer

1 accepted

0 votes
Answer accepted
Ben Atlassian Team Nov 29, 2022

Hey Krunal,

Welcome to the Bitbucket Cloud community!

I would suggest including the following line of code in your bitbucket-pipelines.yml file to the affected step - this will allow you to determine which part of the step is exceeding the build memory limit:

- while true; do date && echo "Memory usage in megabytes:" && echo $((`cat /sys/fs/cgroup/memory/memory.memsw.usage_in_bytes | awk '{print $1}'`/1048576)) && echo "" && sleep 30; done &

 

Cheers!

- Ben (Bitbucket Cloud Support)

I'm getting issue on below step

step:
size2x
nameTest
caches:
gradle
script:
./gradlew test

in which section i put this solution?
Ben Atlassian Team Dec 14, 2022

Hey Krunal,

You would put it in the "script" section at the top :)

Cheers!

- Ben (Bitbucket Cloud Support)

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events