From f5356971e023228fc5a93d94101823646aed6d1e Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Wed, 1 Jul 2026 16:42:44 +0200 Subject: [PATCH 1/3] 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 --- build.gradle.kts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 93c82cd8c9..2e334f43a6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -103,10 +103,6 @@ allprojects { TestLogEvent.PASSED, TestLogEvent.FAILED ) - - // Cap JVM args per test - minHeapSize = "256m" - maxHeapSize = "2g" } withType().configureEach { options.compilerArgs.addAll(arrayOf("-Xlint:all", "-Werror", "-Xlint:-classfile", "-Xlint:-processing", "-Xlint:-try")) From a32ae63064b8df0d3c8e388d5eb28e60697cfee3 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Wed, 1 Jul 2026 16:57:08 +0200 Subject: [PATCH 2/3] 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 --- sentry-android-core/build.gradle.kts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sentry-android-core/build.gradle.kts b/sentry-android-core/build.gradle.kts index f7440b1949..b848ddcdd3 100644 --- a/sentry-android-core/build.gradle.kts +++ b/sentry-android-core/build.gradle.kts @@ -40,6 +40,12 @@ android { unitTests.apply { isReturnDefaultValues = true isIncludeAndroidResources = true + // Robolectric loads the android-all jar into each test JVM, which needs more heap + // than the default. This cap used to live in the root build.gradle.kts for all modules. + all { + it.minHeapSize = "256m" + it.maxHeapSize = "2g" + } } } From a79709fa97b9dfa796fdd6e1300e2d0cc2cafcb8 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Wed, 1 Jul 2026 17:09:03 +0200 Subject: [PATCH 3/3] build: Drop stale comment about root build.gradle.kts Co-Authored-By: Claude Opus 4.8 --- sentry-android-core/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry-android-core/build.gradle.kts b/sentry-android-core/build.gradle.kts index b848ddcdd3..0388b7de48 100644 --- a/sentry-android-core/build.gradle.kts +++ b/sentry-android-core/build.gradle.kts @@ -41,7 +41,7 @@ android { isReturnDefaultValues = true isIncludeAndroidResources = true // Robolectric loads the android-all jar into each test JVM, which needs more heap - // than the default. This cap used to live in the root build.gradle.kts for all modules. + // than the default. all { it.minHeapSize = "256m" it.maxHeapSize = "2g"