How can I OOM sooner in excessive GC? [duplicate]

狂风中的少年 提交于 2019-12-21 16:58:17

问题


Occasionally my JVM runs out of memory, but rather then OOMing which I can recover from (or heapDumpOnOOM and debug) it tends to thrash in GC for hours before throwing out of memory. This is essentially the same as the (unanswered) question: How can I configure the Java GC Overhead Limit? But I suspect the answer is you can't tune the 98%/2% thresholds, so I'm asking of any way to achieve similar effect. notice excessive GC, and preferably cause OOM, or kill the JVM or such.


回答1:


Oracle's GC ergonomics guide covers options for both thresholds. GCTimeLimit and GCHeapFreeLimit. Lowering the former and increasing the latter should result in OOMs occuring sooner.



来源:https://stackoverflow.com/questions/25600720/how-can-i-configure-the-java-gc-overhead-limit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!