title: How to increase scala stack size?
body: <p>I am getting a <code>java.lang.StackOverflowError</code>, when I execute a Scala program.</p>
  
  <p>I believe that the stack size can be set with <code>-DXss=n</code>, but it does not work
  on my system:</p>
  
  <pre><code>  Scala compiler version 2.7.7final and
    Linux 2.6.38-8-generic #42-Ubuntu 
  </code></pre>
  
  <p>The attached program witnesses the problem on my system.</p>
  
  <pre><code>// scalac StackOverflow.scala
  // scala StackOverflow 6000
  // scala -DXms=200M -DXmx=200M -DXss=200M StackOverflow 6000
  
  object StackOverflow {
    def recur(k: Double): Double = {
      // check effects of various commands
      println(k)
      // try to prevent tail recursion
      if (k&gt;0) return recur(k-1)+k/(k+1)
      else return 0.0
    }
    def main(args: Array[String]) {
      if (args.length == 0) println("Missing argument");
      val k = args(0).toInt+0.1
      recur(k)
    }
  }
  </code></pre>
  
  <p>Sergio</p>