java.lang.OutOfMemoryError: GC overhead limit exceeded


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”。


你可能感兴趣的:(java.lang.OutOfMemoryError: GC overhead limit exceeded)