# Memory budget. The Flutter template ships `-Xmx8G -XX:MaxMetaspaceSize=4G` # here, which asks for more than this 7.6 GB machine has and got a whole # session OOM-killed. What actually brings the footprint down is cutting the # NUMBER of JVMs, not just the heap: without these flags Gradle runs a daemon # plus a separate Kotlin compile daemon plus workers, each with its own heap. # # Budget for anything run on this machine is <= 2 GB. Verify with PSS summed # from /proc//smaps_rollup across the build's own processes — system-wide # "used" includes everything else, and RSS double-counts shared pages. org.gradle.jvmargs=-Xmx768m -XX:MaxMetaspaceSize=512m -XX:ReservedCodeCacheSize=128m -XX:+HeapDumpOnOutOfMemoryError # Compile Kotlin inside the Gradle process instead of spawning a second daemon. kotlin.compiler.execution.strategy=in-process # No persistent daemon, no parallel project execution, one worker. org.gradle.daemon=false org.gradle.parallel=false org.gradle.workers.max=1 android.useAndroidX=true # This newDsl flag was added by the Flutter template android.newDsl=false # This builtInKotlin flag was added by the Flutter template. Kept false to # match every sibling app (todo, habit_stack, home_inventory, diet_guard_app), # which all build fine on this same AGP 9.0.1 / Gradle 9.1.0 pair. android.builtInKotlin=false