我注意到我的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.
更多推荐
Scala编译时如何防止java.lang.OutOfMemoryError:PermGen空间?
发布评论