Loko
March 14, 2024

Major GC Algorithms

Posted on March 14, 2024  •  5 minutes  • 916 words  • Other languages:  Korean
Table of contents

This article was written with the intention of studying major GC algorithms more deeply while participating in the ‘Optimizing Java’ study.

Serial GC

❖ Enable Serial GC flag

java -XX:+UseSerialGC

Parallel GC

❖ Enable Parallel GC flag

java -XX:+UseParallelGC

Parallel Old GC

❖ Enable Parallel Old GC flag

java -XX:+UseParallelOldGC

CMS GC

Concurrent Mark Sweep

cms-gc

❖ When prefixed with “Concurrent,” it means it is performed concurrently during application operation

Advantages

Disadvantages

❖ Enable CMS GC flag

java -XX:+UseConcMarkSweepGC

G1 GC

Garbage First

g1-gc

GC Phases

RSet (Remembered Set)

rset

Minor GC

Major GC

g1-gc-process

❖ Enable G1 GC flag

java -XX:+UseG1GC

Z GC

zgc-concept-1

Colored Pointers

colored-pointers

Load Barriers

zgc-concept-7

GC Phases

❖ Overwhelmingly low STW time with Z GC

zgc-performance

❖ Enable Z GC flag

java -XX:+UseZGC

⚠️ For versions before Java 15, the -XX:+UnlockExperimentalVMOptions option must be added

References

Contact me

email: nmin1124@gmail.com