我的应用程序执行大数据数组处理,并且需要比JVM默认提供的内存更多的内存.我在Java中知道它是由"-Xmx"选项指定的.如何设置SBT以使用特定的"-Xmx"值来运行具有"运行"操作的应用程序?
我有一段时间以来一直面临这个错误.完全因此而烦恼.尝试了在stackoverflow和其他站点中看到的所有类似解决方案.
我有4个单独的scala项目.其中,我在编译拖曳项目时遇到StackOverflow错误.这两个项目是4个项目中最大的项目.当我尝试在Ubuntu Server机器中构建项目时,我收到此错误.我尝试在sbt配置文件中增加Xmx选项,但没有成功.
任何人都可以帮我解决这个问题,因为我因此而生气.如果我构建项目10次,它将在1或2次尝试中成功.
我从错误日志中理解的是,问题伴随着类型检查.但是,我不知道发生了什么.
其中一个失败的项目有超过1000个类/特征(不包括案例类).
细节:
Ubuntu Server(14)
Sbt : 0.13.6 and 0.13.8 tried
Scala Version : 2.11.6
JDK: 1.8
Run Code Online (Sandbox Code Playgroud)
下面粘贴了几行错误:
java.lang.StackOverflowError
at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:696)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$96.apply(Typers.scala:4523)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$96.apply(Typers.scala:4523)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:680)
at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4522)
at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4578)
at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5343)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5360)
at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:696)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5472)
at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5480)
at scala.tools.nsc.transform.Erasure$Eraser.adaptMember(Erasure.scala:642)
at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:696)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$96.apply(Typers.scala:4523)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$96.apply(Typers.scala:4523)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:680) …Run Code Online (Sandbox Code Playgroud) 我正在使用sbt建立火花.当我运行以下命令时:
sbt/sbt assembly
Run Code Online (Sandbox Code Playgroud)
建立火花需要一些时间.出现了几个警告,最后我得到以下错误:
[error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space
[error] Use 'last' for the full log.
Run Code Online (Sandbox Code Playgroud)
当我使用命令sbt sbtVersion检查sbt版本时,我得到以下结果:
[warn] Multiple resolvers having different access mechanism configured with same name 'sbt-plugin-releases'. To avoid conflict, Remove duplicate project resolvers (`resolvers`) or rename publishing resolver (`publishTo`).
[warn] There may be incompatibilities among your library dependencies.
[warn] Here are some of the libraries that were evicted:
[warn] * com.typesafe.sbt:sbt-git:0.6.1 -> 0.6.2
[warn] * com.typesafe.sbt:sbt-site:0.7.0 -> 0.7.1
.......
[info] streaming-zeromq/*:sbtVersion
[info] 0.13.7 …Run Code Online (Sandbox Code Playgroud)