From e8eded4ca29c45cb900f60c592392626cc40809b Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Fri, 2 Aug 2024 16:04:06 +0200 Subject: [PATCH] Set MaxMetaspace for Stratego to build --- gradle.properties | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 gradle.properties 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 +