我使用的是宏重的scala-pickling和shapeless,我一直用内存不足的错误破坏Scala2.10.3编译器。错误消息的尾部如下所示:
[error] <tpt> // tree.tpe=tasks.anonfun$218
[error] Block( // tree.tpe=Unit
[error] Apply( // def <init>(): scala.runtime.AbstractFunction1 in class AbstractFunction1, tree.tpe=scala.runtime.AbstractFunction1
[error] SimpleMiddlebury$$anonfun$218.super."<init>" // def <init>(): scala.runtime.AbstractFunction1 in class AbstractFunction1, tree.tpe=()scala.runtime.AbstractFunction1
[error] Nil
[error] )
[error] ()
[error] )
[error] )
[error] )
[error]
[error] == Expanded type of tree ==
[error]
[error] ConstantType(value = Constant(anon$326))
[error]
[error] uncaught exception during compilation: java.io.IOException
[error] Cannot allocate memory我正在监视我的系统内存,而且有很多,所以如果这真的是内存分配的问题,我想我可以设置一些JVM标志来解决这个问题。
但是,我已经尝试通过将帕普氏sbt脚本中的堆设置调整为-Xmx8g来增加可用内存,而且我仍然会遇到这个错误。这是正确的旗帜吗?
想法?
编辑:我添加了“Scala-泡菜”和“无形状”标签,因为这是这些库的其他用户可能遇到的情况。
发布于 2018-04-19 23:09:04
在sbt安装目录中有一个文件./bin/sbt
将此文件中的-Xss设置更新到更高的阈值。将其设置为-Xss8M就足以使我的未成形堆栈溢出编译问题消失。
https://stackoverflow.com/questions/19825809
复制相似问题