java.lang.OutOfMemoryError:Scala上超出了GC开销限制

时间:2016-04-12 10:14:16

标签: eclipse scala playframework-2.0

我是Scala开发人员,我在路由文件中收到此错误,如果我添加另一行给出的话,则 1008行 低于错误..

Uncaught error from thread [sbt-web-scheduler-1] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[sbt-web]
java.lang.OutOfMemoryError: GC overhead limit exceeded
        at java.util.jar.Manifest$FastInputStream.<init>(Unknown Source)
        at java.util.jar.Manifest$FastInputStream.<init>(Unknown Source)
        at java.util.jar.Manifest.read(Unknown Source)
        at java.util.jar.Manifest.<init>(Unknown Source)
        at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
        at java.util.jar.JarFile.getManifest(Unknown Source)
        at sun.misc.URLClassPath$JarLoader$2.getManifest(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
[ERROR] [04/12/2016 15:17:32.883] [sbt-web-scheduler-1] [ActorSystem(sbt-web)] exception on LARSÆ timer thread
        at java.net.URLClassLoader.access$100(Unknown Source)
java.lang.OutOfMemoryError: GC overhead limit exceeded
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at akka.actor.LightArrayRevolverScheduler$$anon$8.nextTick(Scheduler.scala:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at akka.actor.LightArrayRevolverScheduler$$anon$8.run(Scheduler.scala:375)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)

        at akka.event.Logging$Info$.apply(Logging.scala:665)
        at akka.event.BusLogging.notifyInfo(Logging.scala:1140)
        at akka.event.LoggingAdapter$class.info(Logging.scala:950)
        at akka.event.BusLogging.info(Logging.scala:1128)
        at akka.actor.LightArrayRevolverScheduler$$anon$8.run(Scheduler.scala:382)
[ERROR] [04/12/2016 15:18:33.808] [sbt-web-scheduler-1] [ActorSystem(sbt-web)] Uncaught error from thread [sbt-web-scheduler-1]         at java.lang.Thread.run(Unknown Source)
shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.OutOfMemoryError: GC overhead limit exceeded
        at java.util.jar.Manifest$FastInputStream.<init>(Unknown Source)
        at java.util.jar.Manifest$FastInputStream.<init>(Unknown Source)
        at java.util.jar.Manifest.read(Unknown Source)
        at java.util.jar.Manifest.<init>(Unknown Source)
        at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
        at java.util.jar.JarFile.getManifest(Unknown Source)
        at sun.misc.URLClassPath$JarLoader$2.getManifest(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)

路线接受了多少行?我该如何解决这个问题?

编辑:Eclipse

谢谢, B.UdayaKumar

1 个答案:

答案 0 :(得分:2)

通常,当没有足够的空间在Java堆中分配对象时,会抛出此错误。在这种情况下,垃圾收集器无法使空间可用于容纳新对象,并且无法进一步扩展堆。此外,当本机内存不足以支持加载Java类时,可能会抛出此错误。在极少数情况下,当花费过多的时间进行垃圾收集并且释放的内存很少时,可能会抛出LIMIT

你基本上没有内存来顺利运行这个过程。想到的选项是:

  • 使用java.lang.OutOfMemoryError环境变量指定更多内存,尝试介于两者之间的内容,例如 - JAVA_OPTS
  • 您也可以通过启用Xmx1G
  • 手动调整GC

有关GC调整的更多选项,请参阅Concurrent Mark Sweep

增加HEAP大小应该可以解决您的路线限制问题。