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

编程入门 行业动态 更新时间:2024-10-22 08:10:24
本文介绍了java.lang.OutOfMemoryError:Scala超出了GC开销限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是Scala开发人员,我在 Routes 文件中收到此错误,如果我添加了在错误下方给出的另一行,则该文件包含 1008行.

I'M Scala developer,I am getting this error in a Routes file it contains 1008 lines if I add another Line that's throw given below error..

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.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.URLClassLoader.access$100(Unknown Source) java.lang.OutOfMemoryError: GC overhead limit exceeded at java.URLClassLoader$1.run(Unknown Source) at java.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.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.URLClassLoader.defineClass(Unknown Source) at java.URLClassLoader.access$100(Unknown Source) at java.URLClassLoader$1.run(Unknown Source) at java.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method)

路线中接受多少行?我该如何解决?

How Many lines accepted in Routes? How can I solve this?

编辑器:Eclipse

Editor: Eclipse

谢谢, 乌达亚·库玛(B.UdayaKumar)

Thanks By, B.UdayaKumar

推荐答案

通常,当没有足够的空间在Java堆中分配对象时,将引发此错误.在这种情况下,垃圾收集器无法提供空间来容纳新对象,并且堆无法进一步扩展.另外,当本机内存不足以支持Java类的加载时,可能会引发此错误.在极少数情况下,如果花费大量时间进行垃圾回收并且释放了很少的内存,则可能抛出java.lang.OutOfMemoryError.

Usually, this error is thrown when there is insufficient space to allocate an object in the Java heap. In this case, The garbage collector cannot make space available to accommodate a new object, and the heap cannot be expanded further. Also, this error may be thrown when there is insufficient native memory to support the loading of a Java class. In a rare instance, a java.lang.OutOfMemoryError may be thrown when an excessive amount of time is being spent doing garbage collection and little memory is being freed.

实际上,您的内存不足以平稳地运行该过程.想到的选项是:

You're essentially running out of memory to run the process smoothly. Options that come to mind are:

  • 使用JAVA_OPTS环境变量指定更多内存,并尝试在-Xmx1G之间进行尝试.
  • 您还可以通过启用-XX:+UseConcMarkSweepGC
  • 手动调整GC.
  • Specify more memory using the JAVA_OPTS enviroment variable, try something in between like -Xmx1G.
  • You can also tune your GC manually by enabling -XX:+UseConcMarkSweepGC

有关GC调整的更多选项,请参考并发标记扫描

For more options on GC tuning refer Concurrent Mark Sweep

增大HEAP大小应该可以解决路由限制问题.

Increasing the HEAP size should fix your routes limit problem.

更多推荐

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

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

发布评论

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

>www.elefans.com

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