From 786166ba1a28551d60469e7778a63f4ea18a087d Mon Sep 17 00:00:00 2001 From: FryMcNugget Date: Thu, 19 Nov 2026 16:03:56 +0000 Subject: [PATCH] fix(lab): Fast Lab builds no longer run out of memory compiling the app (#2862) --- tools/agent/dd-lab-build | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/agent/dd-lab-build b/tools/agent/dd-lab-build index 33fa47d99f..459b12e640 100755 --- a/tools/agent/dd-lab-build +++ b/tools/agent/dd-lab-build @@ -116,10 +116,11 @@ if [ ! -d "$ANDROID_HOME/platforms/android-34" ]; then "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "platforms;android-34" "build-tools;35.0.0" >/dev/null fi -# A full Kotlin compile of the app runs out of memory with 2.4 GB of heap, and Gradle needs about 1 GB, -# so devices with less memory to spare swap rather than fail. Both daemons end with this script's -# process when the build is done. -heap=${DD_LAB_HEAP_MB:-4096} +# A full Kotlin compile of the app runs out of memory with 2.7 GB of heap, and Gradle needs about 1 GB, +# so devices with less memory to spare swap rather than fail. This script does not stop either daemon: +# when the app runs it, proot's --kill-on-exit ends both with it; run by hand, they outlive it, and the +# Kotlin daemon stays warm for the next incremental compile. +heap=${DD_LAB_HEAP_MB:-6144} kotlin_heap=$(( heap * 2 / 3 )); gradle_heap=$(( heap - kotlin_heap )) # Only the Kotlin daemon compiles incrementally; in-process compiles always redo the whole app, and the