一、错误描述:java.lang.OutOfMemoryError: GC overhead limit exceeded
二、问题产生原因:
根据SUN的说法: 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.
JVM GC行为中超过98%以上的时间去释放小于2%的堆空间时会报这个错误。
三、解决方案:
1、查看系统是否有使用大内存的代码或死循环。
2、可以添加JVM的启动参数来限制使用内存:-XX:-UseGCOverheadLimit