I'm trying to configure metaspace for SBT
export SBT_OPTS="-XX:+CMSClassUnloadingEnabled -XX:MaxMetaspaceSize=512M -XX:MetaspaceSize=256M -Xms2G -Xmx2G"
but when I run sbt -v
, I have the following output :
[process_args] java_version = '1.8.0_11'
# Executing command line:
java
-XX:+CMSClassUnloadingEnabled
-XX:MaxMetaspaceSize=512M
-XX:MetaspaceSize=256M
-Xms2G
-Xmx2G
-Xms1024m
-Xmx1024m
-XX:ReservedCodeCacheSize=128m
-XX:MaxMetaspaceSize=256m
-jar
/usr/local/Cellar/sbt/0.13.7/libexec/sbt-launch.jar
The problem seems that my custom value for MaxMetaspaceSize
is overrided with another value, as shown in output above.
SBT version : 0.13.7
Java version : 1.8
OS : OSX
(copy-pasted from a dear coworker who found the solution)
sbt -mem 2048
=>
-Xms2048m
-Xmx2048m
-XX:ReservedCodeCacheSize=256m
-XX:MaxMetaspaceSize=512m
the default metaspace is based on the xmx value specified with the "-mem" option ;-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With