4

I tried to launch sbt assembly with some library dependencies. When I tried to add

"edu.stanford.nlp" % "stanford-corenlp" % "3.5.1",
"edu.stanford.nlp" % "stanford-corenlp" % "3.5.1" classifier "models",

It closes with an error :

java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space
...
Caused by: java.lang.OutOfMemoryError: Java heap space
...
at sbtassembly.Assembly$.sha1content(Assembly.scala:294)
at sbtassembly.Assembly$$anonfun$24.apply(Assembly.scala:206)
at sbtassembly.Assembly$$anonfun$24.apply(Assembly.scala:202)
...
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

When I add provided property to these librairies, it works well.

I added the options on the build.sbt like mentioned on the README file of SBT assembly but nothing changed.

assemblyOption in assembly := (assemblyOption in assembly).value.copy(cacheUnzip = false)
assemblyOption in assembly := (assemblyOption in assembly).value.copy(cacheOutput = false)
javaOptions in assembly += "-Xmx2g"

Run on

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.1")
scalaVersion := "2.11.6"

Thanks for help

Aurora
  • 41
  • 1
  • 3

1 Answers1

0

Increase heap size of your sbt process as below

set this property in your .bashrc file as a permanent fix. Edit the memeory limit as per your need and resources

export SBT_OPTS="-Xmx1024M -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=2G -Xss2M  -Duser.timezone=GMT"

After edit refresh your console with,

source ~/.bashrc
Thanga
  • 7,811
  • 3
  • 19
  • 38
  • 1
    Added `export SBT_OPTS="-Xmx2048M -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xss4M -Duser.timezone=GMT+1"` but same error. Forgot to mention I use Java 8 so MaxPermSize is not useful. – Aurora Feb 04 '16 at 18:09