Frequent Java Heap Space Errors During Build – Needs Permanent Fix #171525
Replies: 1 comment
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Why are you starting this discussion?
Frequent Java Heap Space Errors During Build – Needs Permanent Fix
Question
What GitHub Actions topic or product is this about?
Frequent Java Heap Space Errors During Build – Needs Permanent Fix
Misc
Discussion Details
@Github_Community
My build is failing every time with the error for my android project in java/kotlin:
Caused by: java.lang.OutOfMemoryError: Java heap spaceAlthough I have already increased the memory, the issue persists. Interestingly, after re-running the build 6–7 times, it eventually passes. This is taking a lot of time and effort. Could you please suggest how I can resolve this issue permanently?
Below is my configurations and some details:
Under yaml file, I am using below environment
env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m"
gradle.properties
org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options="-Xmx2g" -Dcom.android.build.gradle.r8.maxMemory=4g
kotlin.daemon.jvmargs=-Xmx6g -Xms2g
org.gradle.parallel=true
org.gradle.caching =false
android.useAndroidX=true
android.enableJetifier=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
android.enableR8.fullMode=false
settings.gradle
pluginManagement {
buildscript {
repositories {
mavenCentral()
maven {
url = uri("https://storage.googleapis.com/r8-releases/raw")
}
}
dependencies {
classpath("com.android.tools:r8:8.9.35")
}
}
}
include ':app'
Beta Was this translation helpful? Give feedback.
All reactions