3

sbt尝试编译这个项目snowplow/snowplow,分支)时卡住了,sbt_issue然后去OutOfMemory

$ sbt compile
[info] Loading settings for project global-plugins from metals.sbt ...
[info] Loading global plugins from /home/ben/.sbt/1.0/plugins
[info] Loading settings for project beam-enrich-build from plugins.sbt ...
[info] Loading project definition from /home/ben/code/snowplow/3-enrich/beam-enrich/project
[info] Loading settings for project beam-enrich from build.sbt ...
[info] Set current project to beam-enrich (in build file:/home/ben/code/snowplow/3-enrich/beam-enrich/)
[info] Executing in batch mode. For better performance use sbt's shell
[info] Compiling 5 Scala sources to /home/ben/code/snowplow/3-enrich/beam-enrich/target/scala-2.12/classes
[error] ## Exception when compiling 5 sources to /home/ben/code/snowplow/3-enrich/beam-enrich/target/scala-2.12/classes
[error] Java heap space
[error] scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2567)
[error] scala.reflect.internal.Trees.itransform(Trees.scala:1410)
[error] scala.reflect.internal.Trees.itransform$(Trees.scala:1372)
[error] scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] scala.reflect.api.Trees$Transformer.transform(Trees.scala:2563)
[error] scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1706)
[error] scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1703)
[error] scala.reflect.internal.Trees.$anonfun$itransform$1(Trees.scala:1393)
[error] scala.reflect.internal.Trees$$Lambda$3568/531009023.apply(Unknown Source)
[error] scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2608)
[error] scala.reflect.internal.Trees.itransform(Trees.scala:1392)
[error] scala.reflect.internal.Trees.itransform$(Trees.scala:1372)
[error] scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] scala.reflect.api.Trees$Transformer.transform(Trees.scala:2563)
[error] scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1706)
[error] scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1703)
[error] scala.reflect.api.Trees$Transformer.transformValDef(Trees.scala:2578)
[error] scala.reflect.api.Trees$Transformer.$anonfun$transformValDefs$1(Trees.scala:2581)
[error] scala.reflect.api.Trees$Transformer.transformValDefs(Trees.scala:2581)
[error] scala.reflect.api.Trees$Transformer.$anonfun$transformValDefss$1(Trees.scala:2584)
[error] scala.reflect.api.Trees$Transformer.transformValDefss(Trees.scala:2584)
[error] scala.reflect.internal.Trees.$anonfun$itransform$2(Trees.scala:1398)
[error] scala.reflect.internal.Trees$$Lambda$3566/671842794.apply(Unknown Source)
[error] scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2608)
[error] scala.reflect.internal.Trees.itransform(Trees.scala:1397)
[error] scala.reflect.internal.Trees.itransform$(Trees.scala:1372)
[error] scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] scala.reflect.api.Trees$Transformer.transform(Trees.scala:2563)
[error] scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1706)
[error]            
[error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space
[error]         at java.util.concurrent.FutureTask.report(FutureTask.java:122)
[error]         at java.util.concurrent.FutureTask.get(FutureTask.java:192)
[error]         at sbt.ConcurrentRestrictions$$anon$4.take(ConcurrentRestrictions.scala:213)
[error]         at sbt.Execute.next$1(Execute.scala:110)
[error]         at sbt.Execute.processAll(Execute.scala:113)
[error]         at sbt.Execute.runKeep(Execute.scala:90)
[error]         at sbt.EvaluateTask$.liftedTree1$1(EvaluateTask.scala:420)
[error]         at sbt.EvaluateTask$.run$1(EvaluateTask.scala:419)
[error]         at sbt.EvaluateTask$.runTask(EvaluateTask.scala:438)
[error]         at sbt.internal.Aggregation$.$anonfun$timedRun$4(Aggregation.scala:99)
[error]         at sbt.EvaluateTask$.withStreams(EvaluateTask.scala:355)
[error]         at sbt.internal.Aggregation$.timedRun(Aggregation.scala:97)
[error]         at sbt.internal.Aggregation$.runTasks(Aggregation.scala:111)
[error]         at sbt.internal.Aggregation$.$anonfun$applyTasks$1(Aggregation.scala:67)
[error]         at sbt.Command$.$anonfun$applyEffect$2(Command.scala:137)
[error]         at sbt.internal.Aggregation$.$anonfun$evaluatingParser$11(Aggregation.scala:212)
[error]         at sbt.internal.Act$.$anonfun$actParser0$3(Act.scala:435)
[error]         at sbt.Command$.process(Command.scala:181)
[error]         at sbt.MainLoop$.processCommand(MainLoop.scala:151)
[error]         at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:139)
[error]         at sbt.State$$anon$1.runCmd$1(State.scala:246)
[error]         at sbt.State$$anon$1.process(State.scala:250)
[error]         at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:139)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]         at sbt.MainLoop$.next(MainLoop.scala:139)
[error]         at sbt.MainLoop$.run(MainLoop.scala:132)
[error]         at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:110)
[error]         at sbt.io.Using.apply(Using.scala:22)
[error]         at sbt.MainLoop$.runWithNewLog(MainLoop.scala:104)
[error]         at sbt.MainLoop$.runAndClearLast(MainLoop.scala:59)
[error]         at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:44)
[error]         at sbt.MainLoop$.runLogged(MainLoop.scala:35)
[error]         at sbt.StandardMain$.runManaged(Main.scala:138)
[error]         at sbt.xMain.run(Main.scala:89)
[error]         at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:111)
[error]         at xsbt.boot.Launch$.withContextLoader(Launch.scala:130)
[error]         at xsbt.boot.Launch$.run(Launch.scala:111)
[error]         at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:37)
[error]         at xsbt.boot.Launch$.launch(Launch.scala:119)
[error]         at xsbt.boot.Launch$.apply(Launch.scala:20)
[error]         at xsbt.boot.Boot$.runImpl(Boot.scala:56)
[error]         at xsbt.boot.Boot$.main(Boot.scala:18)
[error]         at xsbt.boot.Boot.main(Boot.scala)
[error] Caused by: java.lang.OutOfMemoryError: Java heap space
[error]         at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2567)
[error]         at scala.reflect.internal.Trees.itransform(Trees.scala:1410)
[error]         at scala.reflect.internal.Trees.itransform$(Trees.scala:1372)
[error]         at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error]         at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error]         at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2563)
[error]         at scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1706)
[error]         at scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1703)
[error]         at scala.reflect.internal.Trees.$anonfun$itransform$1(Trees.scala:1393)
[error]         at scala.reflect.internal.Trees$$Lambda$3568/531009023.apply(Unknown Source)
[error]         at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2608)
[error]         at scala.reflect.internal.Trees.itransform(Trees.scala:1392)
[error]         at scala.reflect.internal.Trees.itransform$(Trees.scala:1372)
[error]         at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error]         at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error]         at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2563)
[error]         at scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1706)
[error]         at scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1703)
[error]         at scala.reflect.api.Trees$Transformer.transformValDef(Trees.scala:2578)
[error]         at scala.reflect.api.Trees$Transformer.$anonfun$transformValDefs$1(Trees.scala:2581)
[error]         at scala.reflect.api.Trees$Transformer.transformValDefs(Trees.scala:2581)
[error]         at scala.reflect.api.Trees$Transformer.$anonfun$transformValDefss$1(Trees.scala:2584)
[error]         at scala.reflect.api.Trees$Transformer.transformValDefss(Trees.scala:2584)
[error]         at scala.reflect.internal.Trees.$anonfun$itransform$2(Trees.scala:1398)
[error]         at scala.reflect.internal.Trees$$Lambda$3566/671842794.apply(Unknown Source)
[error]         at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2608)
[error]         at scala.reflect.internal.Trees.itransform(Trees.scala:1397)
[error]         at scala.reflect.internal.Trees.itransform$(Trees.scala:1372)
[error]         at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error]         at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error]         at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2563)
[error]         at scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1706)
[error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space
[error] Use 'last' for the full log.

它编译得很好,很快,在我更改了一些函数的一些返回类型后,问题就出现了。

问题首先发生在:

  • Debian 伸展
  • 斯卡拉 2.12.8
  • sbt 1.2.8
  • java 1.8 (openjdk 和 oracle jdk)

我尝试了几个版本的 Scala,sbt但同样的问题。该错误可以在Travis和 Mac OS 上重现。

我不认为内存是这里的问题,因为我分配了很多:

export SBT_OPTS="-Xms4G -Xmx8G -Xss8M -XX:MaxMetaspaceSize=2G -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC"

知道可能出了什么问题或如何解决这个问题吗?

4

0 回答 0