从javadoc上,发现的OutOfMemoryError发生的真正原因:
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
当98%的时间被用来GC,只有2%的heap空间被释放,就会抛出OutOfMemoryError
原文:
http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html#generations.performance
本文解析了OutOfMemoryError的具体触发条件:当98%的时间用于垃圾回收而仅2%的堆空间得到释放时,将触发该错误。
2062

被折叠的 条评论
为什么被折叠?



