Skip to content

Commit 4414d9f

Browse files
runningcodeclaude
andauthored
build: Remove global per-test JVM heap cap (#5671)
* build: Remove global per-test JVM heap cap The minHeapSize/maxHeapSize cap in the root build.gradle.kts was applied to every module's test task. Most modules do not need it, so remove it and let tests use the JVM defaults. If a specific module turns out to require a larger heap, the cap can be re-added to that module only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * build: Restore per-test heap cap for sentry-android-core CI showed :sentry-android-core:testReleaseUnitTest fails with OutOfMemoryError (Robolectric loading the android-all jar) once the global cap is removed. Restore the 256m/2g cap for this module only, where it is actually needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * build: Drop stale comment about root build.gradle.kts Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 30862fc commit 4414d9f

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

build.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ allprojects {
103103
TestLogEvent.PASSED,
104104
TestLogEvent.FAILED
105105
)
106-
107-
// Cap JVM args per test
108-
minHeapSize = "256m"
109-
maxHeapSize = "2g"
110106
}
111107
withType<JavaCompile>().configureEach {
112108
options.compilerArgs.addAll(arrayOf("-Xlint:all", "-Werror", "-Xlint:-classfile", "-Xlint:-processing", "-Xlint:-try"))

sentry-android-core/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ android {
4040
unitTests.apply {
4141
isReturnDefaultValues = true
4242
isIncludeAndroidResources = true
43+
// Robolectric loads the android-all jar into each test JVM, which needs more heap
44+
// than the default.
45+
all {
46+
it.minHeapSize = "256m"
47+
it.maxHeapSize = "2g"
48+
}
4349
}
4450
}
4551

0 commit comments

Comments
 (0)