21

Per this helpful post, I removed my ~/.sbtconfig, and added .sbtopts:

$cd myProject
$cat .sbtopts
-J-Xmx4G
-J-XX:+CMSClassUnloadingEnabled
-J-XX:MaxPermSize=4G 

Then I ran sbt. How can I, via the sbt console, verify those options set in .sbtopts?

Community
  • 1
  • 1
Kevin Meredith
  • 41,036
  • 63
  • 209
  • 384

3 Answers3

18

If you man sbt, you'll see that there's a debug flag; so, you'll see something like this:

$ sbt -d
[process_args] java_version = '1.7.0_72'
# Executing command line:
java
-Xms1024m
-Xmx1024m
-XX:ReservedCodeCacheSize=128m
-XX:MaxPermSize=256m
-XX:+CMSClassUnloadingEnabled
-XX:+UseConcMarkSweepGC
-jar
/usr/share/sbt-launcher-packaging/bin/sbt-launch.jar

Here's my sbtopts file: /usr/share/sbt-launcher-packaging/conf/sbtopts

-J-XX:+CMSClassUnloadingEnabled
-J-XX:+UseConcMarkSweepGC
pcting
  • 1,286
  • 14
  • 20
5

Latest versions of the jdk comes with a nice tool called jps that tells you about running java processes

jps -v should point you to the processes and show the passed-in options

pagoda_5b
  • 7,333
  • 1
  • 27
  • 40
-1

I don't know if you can do it from within the sbt console but you can add -J-XX:+PrintFlagsFinal to .sbtopts and the JVM will print all the flags.

steinybot
  • 5,491
  • 6
  • 37
  • 55