From c66a9053eed5ce60a010ceefea98f92e6f09c43f Mon Sep 17 00:00:00 2001 From: Zixuan James Li Date: Wed, 5 Feb 2025 18:45:16 -0500 Subject: [PATCH] android build: Allow Gradle to use even more memory, 4 GiB We are pretty certain that the upstream commit https://github.com/flutter/flutter/commit/df114fbe9 was the exact one that caused the increased RAM usage for the Android build. The upstream change causes the engine artifacts to contain debug symbols, which is intentional (as it enables putting debug symbols in the app's bundle artifact) but makes the artifacts about 8x larger. That causes known regressions in CPU and memory use at build time: https://github.com/flutter/flutter/issues/162675 Since the regression was expected, there is no action to be taken upstream. However, we haven't found an effective way to rewrite the build script in a way that this is mitigated without needing to raise the limit. For the investigation details, see CZO discussion: https://chat.zulip.org/#narrow/channel/243-mobile-team/topic/Gradle.20out.20of.20memory Since a previous bump to 3 GiB, the issue has been mitigated, but it still happens some of the time: at least twice in the past day or so. Add another 1 GiB to see if that addresses the flakes. --- android/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/gradle.properties b/android/gradle.properties index 2974fbcb00..b0202e3120 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,4 +1,4 @@ -org.gradle.jvmargs=-Xmx3072M +org.gradle.jvmargs=-Xmx4G android.useAndroidX=true android.enableJetifier=true