Android build failing - Expiring Daemon because JVM heap space is exhausted

#1

Android builds are failing with this error “Expiring Daemon because JVM heap space is exhausted”. If I do the build locally it works.

0 Likes

#2

Hi there @mmajeed! What you’ll need to do here is raise the JVM heap size. You can find instructions on how to do that in our Devcenter .

0 Likes

#3

Hi @ahvth-bitrise, I’ve read instruction show in devcenter and after setting up the heap size I am getting below error;

Retrying…
Failed to ensure android components, error: output: Invalid initial heap size: -Xms512m -Xmx1024m
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
error: exit status 1
| |
±–±--------------------------------------------------------------±---------+
| x | install-missing-android-tools (exit code: 1) | 9.79 sec |
±–±--------------------------------------------------------------±---------+
| Issue tracker: …bitrise-steplib/steps-install-missing-android-tools/issues |
| Source: …://github.com/bitrise-steplib/steps-install-missing-android-tools |
±–±--------------------------------------------------------------±---------+

0 Likes

#4

Hey there @yasheshc!

Could you please share your build URL and enable Support Access (https://devcenter.bitrise.io/troubleshooting/enabling-bitrise-support-user/) so that we may take a closer look and see what is going on with your build? :slight_smile:

0 Likes

#5

Thanks for very quick reply.

Here build URL : https://app.bitrise.io/build/2751429b8480832e#?tab=log

0 Likes

#6

Hi,

Try specifying -Xms512M -Xmx1024M

Thanks,
Cathy

0 Likes

#7

Still getting same error!

Failed to ensure android components, error: output: Invalid initial heap size: -Xms512M -Xmx1024M

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

error: exit status 1

0 Likes

#8

@ahvth-bitrise @Roland-Bak can you please help me on this?

0 Likes

#9

Hi, can you please provide the latest build URL for the latest failed build and enable Support User Access? I would also ask for permission to run a couple of test builds on your account to try and determine the issue.

0 Likes

#10

Here is latest build log URL https://app.bitrise.io/build/3006a97c32d2c0a4#?tab=log

For this project I’ve already enable the support user access.

Yes, I allow to preform test build

0 Likes

#11

Hi there @yasheshc!

It is possible that because you have a cross-platform project and the directory locations are not the same as it would be in a purely android project, you would need to remove the JAVA_OPTS and GRADLE_OPTS Env Vars from your Env Vars tab, and instead directly put the JVM parameters into your gradle.properties file: https://riptutorial.com/gradle/example/11911/tuning-jvm-memory-usage-parameters-for-gradle

Hope this helps! :wink:

0 Likes