Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is UseGCOverheadLimit supported with G1 GC?

In HotSpot JVM GC Tuning Guide the UseGCOverheadLimit option is mentioned only on the pages about CMS and Parallel GCs. Additionally, on GC Ergonomics doc page the related options GCTimeLimit and GCHeapFreeLimit are mentioned like if they work only with Parallel 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 [...]

Are those options supported with -XX:+UseG1GC?

like image 759
leventov Avatar asked Aug 28 '17 19:08

leventov


People also ask

What is difference between concurrent mark sweep and G1 Garbage Collector?

Thus, with each garbage collection, G1 continuously works to reduce fragmentation. This is beyond the capability of both of the previous methods. CMS (Concurrent Mark Sweep) garbage collection does not do compaction. Parallel compaction performs only whole-heap compaction, which results in considerable pause times.

How does G1 GC work?

G1 GC uses the Snapshot-At-The-Beginning (SATB) algorithm, which takes a snapshot of the set of live objects in the heap at the start of a marking cycle. The set of live objects is composed of the live objects in the snapshot, and the objects allocated since the start of the marking cycle.

Which is the best Garbage Collector in Java?

ZGC is a low-latency garbage collector that works well with very large (multi-terabyte) heaps. Like G1, ZGC works concurrently with the application. ZGC is concurrent, single-generation, region-based, NUMA-aware, and compacting. It does not stop the execution of application threads for more than 10ms.

What is default GC in Java 17?

Parallel Garbage Collector. It's the default GC of the JVM, and sometimes called Throughput Collectors.


1 Answers

GC overhead limit is the feature of AdaptiveSizePolicy, which is used in Parallel GC and CMS, but not in G1.

You may also double-check that gc_overhead_limit_was_exceeded flag is never set in G1CollectedHeap::mem_allocate.

So, -XX:+UseGCOverheadLimit does nothing in G1 GC.

like image 83
apangin Avatar answered Oct 21 '22 04:10

apangin