diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 000000000..6528c26a8 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,15 @@ +# In Java 8 and earlier, the metaspace is part of the heap size. In newer Java versions, the metaspace size is +# set to unlimited, reducing the occurrence of OutOfMemoryError: Metaspace. However, by default the Gradle daemon +# runs with a MaxMetaspaceSize of 384 MB (see in this Gradle 8 commit: https://github.com/gradle/gradle/blob/80477c69ff426af47b53cda7f3167ad188935727/platforms/core-runtime/client-services/src/main/java/org/gradle/launcher/daemon/configuration/DaemonParameters.java#L52) +# We set the MaxMetaspaceSize to unlimited to avoid the following error: +# Analysis failed unexpectedly +# org.metaborg.core.analysis.AnalysisException: Failed to get Stratego runtime\ +# Caused by: org.metaborg.core.MetaborgException: Failed to load JAR +# Caused by: org.strategoxt.IncompatibleJarException: Incompatible Stratego jar: file:stratego.jar (Metaspace) +# Caused by: java.lang.OutOfMemoryError: Metaspace +# +# Expiring Daemon because JVM heap space is exhausted +# Expiring Daemon because JVM heap space is exhausted +# Daemon is stopping immediately JVM garbage collector thrashing and after running out of JVM memory and after running out of JVM memory +org.gradle.jvmargs=-Xss16M -Xms512M -Xmx2G -XX:MaxMetaspaceSize=unlimited +