Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>For forked processes you should look at Build.scala</strong> </p> <p>To modify the java options for forked processes you need to specify them in the Build.scala (or whatever you've named your build) like this: </p> <pre><code>val buildSettings = Defaults.defaultSettings ++ Seq( //… javaOptions += "-Xmx1G", //… ) </code></pre> <p>This will give you the proper options without modifying JAVA_OPTS globally, <em>and</em> it will put custom JAVA_OPTS in an <a href="https://github.com/typesafehub/xsbt-start-script-plugin" rel="nofollow noreferrer">sbt generated start-script</a></p> <p>For <strong>non forked</strong> processes it's most convenient to set the config via <code>sbtopts</code> or <code>sbtconfig</code> depending on your sbt version.</p> <p>Since sbt 0.13.6 <a href="https://medium.com/@jan______/sbtconfig-is-deprecated-650d6ff10236" rel="nofollow noreferrer"><code>.sbtconfig</code> is deprecated</a>. Modify <code>/usr/local/etc/sbtopts</code> along these lines:</p> <pre><code>-J-Xms512M -J-Xmx3536M -J-Xss1M -J-XX:+CMSClassUnloadingEnabled -J-XX:+UseConcMarkSweepGC -J-XX:MaxPermSize=724M -J-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 </code></pre> <p><strong>You can also</strong> create an <code>.sbtopts</code> file in the root of your SBT project using the same syntax as in the <code>/usr/local/etc/sbtopts</code> file. This makes the project self-contained.</p> <p><strong>Before sbt 0.13.6</strong> you could set the options in .sbtconfig for <strong>non forked</strong> processes:</p> <ol> <li><p>Check where sbt is:</p> <pre><code>$ which sbt /usr/local/bin/sbt </code></pre></li> <li><p>Look at the contents: </p> <pre><code>$ cat /usr/local/bin/sbt #!/bin/sh test -f ~/.sbtconfig &amp;&amp; . ~/.sbtconfig exec java ${SBT_OPTS} -jar /usr/local/Cellar/sbt/0.12.1/libexec/sbt-launch.jar "$@" </code></pre></li> <li><p>Set the correct jvm options to prevent OOM (both regular and PermGen):</p> <pre><code>$ cat ~/.sbtconfig SBT_OPTS="-Xms512M -Xmx3536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=724M" </code></pre></li> </ol> <p>If you want to set SBT_OPTS only for the current run of sbt you can use <code>env SBT_OPTS=".." sbt</code> as suggested by Googol Shan. Or you can use the option added in Sbt 12: <code>sbt -mem 2048</code>. This gets unwieldy for longer lists of options, but it might help if you have different projects with different needs.</p> <p>Note that CMSClassUnloadingEnabled in concert with UseConcMarkSweepGC helps keep the PermGen space clean, but depending on what frameworks you use you might have an actual leak on PermGen, which eventually forces a restart. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload