About Configuring JVM memory:
The org.gradle.jvmargs Gradle property controls the VM running the build. It defaults to -Xmx512m "-XX:MaxMetaspaceSize=256m"
The JAVA_OPTS environment variable controls the command line client, which is only used to display console output. It defaults to -Xmx64m
But: