如何防止 java.lang.OutOfMemoryError: PermGen space at Scala 编译?

编程入门 行业动态 更新时间:2024-10-22 12:18:22
本文介绍了如何防止 java.lang.OutOfMemoryError: PermGen space at Scala 编译?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我注意到我的 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 编译?

本文发布于:2023-11-25 18:50:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1630923.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何防止   lang   java   OutOfMemoryError   space

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!