您的位置:首页 > 编程语言 > Java开发

java.lang.OutOfMemoryError: GC overhead limit exceeded

2013-11-28 17:25 453 查看
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

这个是JDK6新添的错误类型。在JVM中如果98%的时间是用于GC且可用的
Heap size 不足2%的时候将抛出此异常信息。可以关闭该功能,使用——
-XX:-UseGCOverheadLimit


或者增加堆大小

Heap size的 -Xms 设置不要超出物理内存的大小。否则会提示“Error occurred during initialization of VM Could not reserve enough space for object heap”。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: