Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between G1GC options -XX:ParallelGCThreads vs -XX:ConcGCThreads

Tags:

java

jvm

g1gc

when configuring the G1GC we have 2 kinds of thread count -XX:ParallelGCThreads and -XX:ConcGCThreads what is the difference, how they are going to impact, any reference is appreciated.

like image 528
RamiReddy P Avatar asked Jan 10 '19 09:01

RamiReddy P


People also ask

Is G1GC better than CMS?

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.

Is Zgc better than G1GC?

Yield that ZGC unexpectedly has higher throughput and longer total execution time than G1GC, and other attributes are in line with expectations. According to the results, ZGC has a better overall performance than G1GC under the testing circumstances.

What is parallel GC and G1GC?

A garbage collector (GC) is a memory management tool. The G1 GC achieves automatic memory management through the following operations: Allocating objects to a young generation and promoting aged objects into an old generation. Finding live objects in the old generation through a concurrent (parallel) marking phase.

What is the difference between parallel GC and CMS GC?

The major difference between Parallel GC and CMS GC is the old generation collection. For CMS GC, the old generation collections attempt to avoid long pauses in application threads.


1 Answers

G1 algorithm has phases which some of them are "stop the world" phases that stops the application during garbage collection, and it also has phases which happens concurrently while application is running(candidate marking etc..), with that information in mind:

ParallelGCThreads option affects the number of threads used for phases when application threads are stopped, and the ConcGCThreads flag affects the number of threads used for concurrent phases.

like image 146
Dogukan Zengin Avatar answered Oct 31 '22 18:10

Dogukan Zengin