Gradle Kotlin daemon infinite loop until JVM max memory runs out

Open
#193 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
android, docker, gitlab, kotlin, react-native

Research direction

Start with the linked job.log and the GitLab CI/CD pipeline environment for the react-nativecommunity/react-native-android image. Focus on the ./gradlew bundleRelease entry point and the :react-native-gradle-plugin:compileKotlin task, comparing runs with and without diagnostic options. Done means identifying a reproducible cause or a concrete fix for the Kotlin daemon loop and memory exhaustion.

Written by the indexing model from the issue text.

Description

Hello, thank you react native community for supporting this Docker image!

Issue Environment:

  • Runtime: GitLab CI/CD Pipeline Job
  • Image: reactnativecommunity/react-native-android:latest (also tried 6.0 and 5.4)
  • Gradle: 7.5.1
  • Android SDK Level: 31
  • jvmargs: -Xmx16g -Xms2g \ -XX\:MetaspaceSize\=512m -XX\:MaxMetaspaceSize\=1g \ -XX\:NewSize\=256m -XX\:MaxNewSize\=3g \ -Dfile.encoding\=UTF-8
  • Dependencies: node_modules is downloaded from previous job which contains the necessary react native modules

Issue Description:
When attempting to run ./gradlew bundleRelease the Gradle daemon starts as expected but on the first task :react-native-gradle-plugin:compileKotlin causes an infinite loop with the Gradle kotlin daemon. When running with no options, the daemon runs out of memory (15.7GiB) and closes at about 15 minutes of running. With info or debug/stacktrace option, daemon runs out of memory and closes at about 45 minutes of running.

Issue Reproduction:
I cannot reproduce this issue locally, only in the pipeline pod which uses this Docker image. Please look through the debug/stacktrace log dump below.

Issue Logs:
job.log

I am grateful for any expert to provide a diagnosis on what could be causing this!

Dominant language
Dockerfile
Stars
541
Forks
152
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from react-native-community/docker-android

All issues in react-native-community/docker-android

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.