0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-19 19:42:17 +02:00

build: cut memory usage for gradle daemons

gradle heap was very large, and while we need slightly larger
than normal heap, we do not need excessively large heap

when too large, it causes operating system level virtual memory
thrashing on windows workflow runners in github, leading to flaky
builds as the workers are slow and time out

additionally, the kotlin compiler daemon takes up it's own massive
chunk of memory, but can run in-process with almost no performance
affect I can detect, but with elimination of GBs of RAM used

finally, test daemons can inherit main daemon settings now as they
are equivalent
This commit is contained in:
Mike Hardy 2022-05-12 21:14:49 -05:00
parent f604eb8a56
commit f5ecb05efc
2 changed files with 2 additions and 4 deletions

View File

@ -54,8 +54,6 @@ subprojects {
maxParallelForks = gradleTestMaxParallelForks
forkEvery = 40
maxHeapSize = "2048m"
minHeapSize = "1024m"
systemProperties['junit.jupiter.execution.parallel.enabled'] = true
systemProperties['junit.jupiter.execution.parallel.mode.default'] = "concurrent"
}

View File

@ -9,7 +9,7 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-XX\:+UseParallelGC -Xmx4096M -Dkotlin.daemon.jvm.options\="-Xmx3072M" -XX\:MaxPermSize\=2048m -XX\:+HeapDumpOnOutOfMemoryError -Dfile.encoding\=UTF-8
org.gradle.jvmargs=-Xmx2048M -Dkotlin.compiler.execution.strategy=in-process -Dfile.encoding=UTF-8
# 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
@ -29,4 +29,4 @@ org.gradle.caching=true
org.gradle.vfs.watch=true
# Opt in to gradle 8 behavior, silence warning for now. Remove with AGP8+
android.disableAutomaticComponentCreation=true
android.disableAutomaticComponentCreation=true