java.lang.StackOverflowError当我执行Scala程序时,我得到了一个.
我相信堆栈大小可以设置-DXss=n,但它不适用于我的系统:
Scala compiler version 2.7.7final and
Linux 2.6.38-8-generic #42-Ubuntu
Run Code Online (Sandbox Code Playgroud)
附件程序见证了我系统上的问题.
// 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>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)
}
}
Run Code Online (Sandbox Code Playgroud)
塞尔吉奥
我在我的 Maven 项目中发现了一个相关的错误Scala-maven-plugin。我有一个很长的特征序列(用于机器学习目的),我手动编码(74 个元素)。
我在序列中添加了一个元素,但它不再编译。如果我注释该序列的任何元素,元素数量就会减少并且可以编译。
有关更多信息,这是我编译的最终输出:
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.3.1:compile (default) on project SecretProject: wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 240 (Exit value: 240) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] …Run Code Online (Sandbox Code Playgroud)