Skip to content

Overriding stack size (-Xss) fails except via SBT_OPTS #5181

@sloshy

Description

@sloshy

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:

  1. Add a rule that selectively overrides -Xss if the argument is present when launching sbt
  2. Apply java arguments after the defaults so that the defaults are only selectively overridden (this is the behavior for SBT_OPTS currently 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugarea/runner-scriptissues around sbt-the-bash-script, or bat script

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions