我如何更快地使用过量的GC? [英] How can I OOM sooner in excessive GC?

查看:132
本文介绍了我如何更快地使用过量的GC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时候,我的JVM耗尽内存,而不是OOMing,我可以从中恢复(或堆dumpOnOOM和调试),它往往会在内存溢出之前在GC中出现几个小时的颠簸。
这与(未回答)问题基本相同:如何配置Java GC开销限制?
但我怀疑答案是您无法调整98%/ 2%的阈值,所以我想要以任何方式实现类似影响。注意过多的GC,最好是导致OOM,或者杀死JVM等。 解决方案

Oracle的 GC人体工程学指南涵盖了这两个阈值的选项。 GCTimeLimit GCHeapFreeLimit 。降低前者和增加后者应该会导致OOMs更快发生。

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.

解决方案

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.

这篇关于我如何更快地使用过量的GC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆