java.lang.OutOfMemoryError: GC overhead limit exceeded
这个是JDK6新添的错误类型。是发生在GC占用大量时间为释放很小空间的时候发生的,是一种保护机制。解决方案是,关闭该功能,使用—— -XX:-UseGCOverheadLimit
这里要查看是否有使用大内存的代码或死循环。
Sun官方解释:
The parallel / concurrent collector will throw an OutOfMemoryError
if too much time is being spent in garbage collection: if more than 98% of the total time is spent in garbage collection and less than 2% of the heap is recovered, an OutOfMemoryError will be thrown. This feature is designed to prevent applications from running for an extended period of time while making little or no progress because the heap is too small. If necessary, this feature can be disabled by adding the option -XX:-UseGCOverheadLimit
to the command line
一、异常如下:
Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
二、解释:
JDK6新增错误类型。当GC为释放很小空间占用大量时间时抛出。
一般是因为堆太小。导致异常的原因:没有足够的内存。
三、解决方案:
1、查看系统是否有使用大内存的代码或死循环。
2、可以添加JVM的启动参数来限制使用内存:-XX:-UseGCOverheadLimit
上一篇: netty系列(0)----非常浅薄的初探或者叫读书笔记
下一篇: 对自己写的代码的反思 编程
推荐阅读
-
java.lang.OutOfMemoryError: GC overhead limit exceeded
-
AndroidStudio报错GC overhead limit exceeded的解决方案
-
在Intellij IDEA下编译Java项目,报错:java.lang.OutOfMemoryError: ...(此处忽略) GC overhead lim
-
8、grails 打war报错 Error Error executing script War: GC overhead limit exceeded
-
sparksql java.lang.OutOfMemoryError: GC overhead limit exceeded
-
java.lang.OutOfMemoryError: GC overhead limit exceeded
-
java.lang.OutOfMemoryError: GC overhead limit exceeded
-
java.lang.OutOfMemoryError:GC overhead limit exceeded
-
java.lang.OutOfMemoryError:GC overhead limit exceeded
-
java.lang.OutOfMemoryError: GC overhead limit exceeded