Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I configure the Java GC Overhead Limit? [duplicate]

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.

like image 326
Meir Maor Avatar asked Nov 22 '22 13:11

Meir Maor


1 Answers

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.

like image 77
the8472 Avatar answered Dec 28 '22 07:12

the8472