-
Notifications
You must be signed in to change notification settings - Fork 1k
Overriding stack size (-Xss) fails except via SBT_OPTS #5181
Description
steps
sbt version: 1.3.2
problem
Overriding the stack size via .jvmopts, or the -J flag fails. Stack size is set to the default 4M value even when overridden.
expectation
Overriding the stack size by itself should work no matter the method.
notes
Using SBT_OPTS works correctly. I've traced this down to the launcher script for sbt and have identified a workaround for the time being. If you specify a memory option (-Xm*) then the portion of code in the launcher script that sets the stack size will not be called.
A couple ideas on how this could be fixed:
- Add a rule that selectively overrides
-Xssif the argument is present when launching sbt - Apply java arguments after the defaults so that the defaults are only selectively overridden (this is the behavior for
SBT_OPTScurrently when changing the stack size)
To reproduce: open any SBT project and set the stack size via -J or .jvm/sbtopts. Run sbt -d to see the order of JVM args as they are applied. Note that the stack size parameter is applied before the defaults which override it. Now set it via SBT_OPTS and see that your option is specified after the default argument, overriding it.