Files
amethyst/gradle.properties
T
Claude 66df23fc2c build: right-size Kotlin daemon heap from 12g/4g to 8g/2g
Measured the actual Kotlin daemon peak RSS during a full cold compile
of :amethyst:compilePlayDebugKotlin (which transitively compiles
:quartz, :commons, :quic, :nestsClient as well, in parallel after the
earlier parallel-mode change). Peak RSS was ~6.3 GB at the previous
12g/4g setting, meaning heap usage peaked around 4-5 GB plus
metaspace and native memory.

Drops to -Xmx8g -XX:MaxMetaspaceSize=2g, which:

- Cuts committed-virtual-memory ask from 18 GB (Gradle 6g + Kotlin 12g)
  to 14 GB, comfortably under typical CI runner RAM and well under the
  15 GB available in this dev environment.
- Frees ~4 GB of headroom for the OS file cache, which speeds up
  classpath snapshot I/O on incremental builds.
- Leaves clear headroom over peak usage so GC pressure stays low; we
  re-measured cold compile after the change at 3m30s vs 3m34s before,
  well within run-to-run noise.
- Peak Kotlin daemon RSS at the new setting: 4.96 GB, confirming the
  daemon right-sizes itself rather than pinning the ceiling.

If a much larger codebase target lands later (e.g. iOS framework
compilation in this same daemon), bump back up — the value is not
sacred, it just shouldn't request more than the host can afford.
2026-05-16 14:54:44 +00:00

33 lines
1.6 KiB
Properties

# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx6g -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel=true
org.gradle.caching=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.enableR8.fullMode=true
kotlin.daemon.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=2g
# because we use a custom jvmAndroid target
kotlin.mpp.applyDefaultHierarchyTemplate=false
# This is needed for the Swift bridge to work.
kotlin.mpp.enableCInteropCommonization=true