在 HotSpot JVM GC Tuning Guide 中,UseGCOverheadLimit
选项仅在有关 CMS 和并行 GC 的页面上提及。此外,在 GC Ergonomics doc 页面上提到了相关选项 GCTimeLimit
和 GCHeapFreeLimit
,就像它们仅适用于并行 GC:
The parallel garbage collector (UseParallelGC) throws an out-of-memory exception if an excessive amount of time is being spent collecting a small amount of the heap. To avoid this exception, you can increase the size of the heap. You can also set the parameters -XX:GCTimeLimit=time-limit and -XX:GCHeapFreeLimit=space-limit [...]
-XX:+UseG1GC
是否支持这些选项?
最佳答案
GC 开销限制是 AdaptiveSizePolicy 的特性,用于 Parallel GC 和 CMS,但 not in G1 。
您也可以仔细检查 gc_overhead_limit_was_exceeded
标志从未在 G1CollectedHeap::mem_allocate
中设置。
所以,-XX:+UseGCOverheadLimit
在 G1 GC 中什么都不做。
关于java - G1 GC 是否支持 UseGCOverheadLimit?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45925980/