Skip to content

Commit

Permalink
Set MaxMetaspace for Stratego to build
Browse files Browse the repository at this point in the history
  • Loading branch information
Virtlink committed Aug 2, 2024
1 parent 2ec2b73 commit e8eded4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e8eded4

Please sign in to comment.