我注意到我的 scala 编译器有一个奇怪的行为.编译类时偶尔会抛出 OutOfMemoryError.这是错误消息:
I have noticed a strange behavior of my scala compiler. It occasionally throws an OutOfMemoryError when compiling a class. Here's the error message:
[info] Compiling 1 Scala source to /Users/gruetter/Workspaces/scala/helloscala/target/scala-2.9.0/test-classes... java.lang.OutOfMemoryError: PermGen space Error during sbt execution: java.lang.OutOfMemoryError: PermGen space它只会偶尔发生一次,并且通常不会在随后的编译运行中抛出错误.我使用 Scala 2.9.0 并通过 SBT 编译.
It only happens once in a while and the error is usually not thrown on the subsequent compile run. I use Scala 2.9.0 and compile via SBT.
有人知道导致此错误的原因可能是什么吗?提前感谢您的见解.
Does anybody have a clue as to what might be the cause for this error? Thanks in advance for your insights.
推荐答案OutOfMemoryError: PermGen space的原因是没有足够的永久代空间 :) 如果你使用的是 Oracle JVM,你需要将 -XX:MaxPermSize=256M (或其他一些空间量)参数添加到您的 sbt 脚本中.对于其他 JVM,请查看他们的文档.
The cause for OutOfMemoryError: PermGen space is that it doesn't have enough permanent generation space :) If you are using Oracle JVM, you need to add the -XX:MaxPermSize=256M (or some other amount of space) argument to your sbt script. For other JVMs, look at their documentation.
更多推荐
如何防止 java.lang.OutOfMemoryError: PermGen space at Scala 编译?
发布评论