[Why] The Java Virtual Machine(JVM) maximum heap size(-Xmx) is 512M by default. It will occur out of memory eror when compiling for Android. Android compiling error: "java.lang.OutOfMemoryError: Java heap space". [How] Configure JVM memory for Gradle by setting Gradle property org.gradle.jvmargs in gradle.properties file. This gradle.properties file was generated by Android Studio settings. Reference: https://developer.android.com/build/optimize-your-build?utm_source=android-studio#increase-the-jvm-heap-size https://docs.gradle.org/7.2/userguide/build_environment.html#sec:configuring_jvm_memory
14 lines
748 B
Properties
14 lines
748 B
Properties
## 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.
|
|
# Default value: -Xmx1024m -XX:MaxPermSize=256m
|
|
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -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
|
|
#Sun May 28 17:34:07 CST 2023
|
|
org.gradle.jvmargs=-Xmx4096M
|