-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgradle.properties
More file actions
32 lines (28 loc) · 1.58 KB
/
Copy pathgradle.properties
File metadata and controls
32 lines (28 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## Gradle JVM — sized for the KSP + Kotlin 2 toolchain.
##
## CRITICAL: the heap CAN NOT be too large here. With CompressedOops the Java heap is mapped
## into the first 32 GB of address space, and the **native** heap (where KSP / kotlinc
## metaspace + ZipFile + code-cache + JIT scratch live) grows BELOW the Java heap base.
## With Xmx=4G we observed `OutOfMemoryError: malloc failed` crashing the daemon during KSP
## processing (`hs_err_pid*.log` at project root). 2 GB is plenty for our project and frees
## ~2 GB of native space.
##
## ReservedCodeCacheSize + CompressedClassSpaceSize give the JIT and class metadata explicit
## bounds so they cannot starve each other on long-running daemons (Gradle keeps the daemon
## alive across builds — fragmentation accumulates).
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=1g -XX:CompressedClassSpaceSize=256m -XX:ReservedCodeCacheSize=512m -XX:+UseParallelGC -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.caching=true
## Configuration cache is great but new — turn off until first stable build, easier to debug.
org.gradle.configuration-cache=false
org.gradle.daemon=true
android.useAndroidX=true
android.nonTransitiveRClass=true
android.nonFinalResIds=true
kotlin.code.style=official
kotlin.incremental=true
## Kotlin compiler daemon — its own JVM, doesn't share with Gradle daemon. 1.5 GB is enough
## for our codebase (largest single file is ~1000 lines).
kotlin.daemon.jvmargs=-Xmx1536m -XX:MaxMetaspaceSize=512m -XX:+UseParallelGC -Dfile.encoding=UTF-8
## KSP 2 is the new generation processor — required for AGP 8.13+.
ksp.useKSP2=true