Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase memory in sbt-assembly

Is there a way to increase the memory during assembly (the plugin)? I notice that adding more memory to sbt through SBT_OPTS does't really help. I suspect that assembly is forking a separate JVM that doesn't inherit the JVM configurations from sbt.

Here is the error:

java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space

Here is what I tried without much luck:

javaOptions in assembly += "-Xmx2g"

like image 940
marios Avatar asked Feb 26 '26 00:02

marios


1 Answers

I suspect that assembly is forking a separate JVM that doesn't inherit the JVM configurations from sbt.

I'm the author of sbt-assembly. assembly does not fork a separate JVM. You can see the code here and check - https://github.com/sbt/sbt-assembly/blob/0.13.0/src/main/scala/sbtassembly/Assembly.scala#L239-L246

like image 176
Eugene Yokota Avatar answered Feb 28 '26 18:02

Eugene Yokota



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!