Are Java Garbage Collectors specific to Major GC?

Nick :

So there are 2 types of Garbage Collection process JVM does: Minor GC and Major GC. And different types of Garbage Collectors are there : Serial, Parallel, CMS, G1C etc. And these Garbage collectors does the garbage collection process differently according to different algorithms they implement.

As per Oracle documentation of CMS,

Minor collections can interleave with an ongoing major cycle, and are done in a manner similar to the parallel collector (in particular, the application threads are stopped during minor collections).

Does this means that all the Garbage collectors characterizes and controls Major GC only? In other words, is the behavior of Minor GC same regardless of the Garbage Collector chosen?

the8472 :

Collectors are implementation details of JVMs, the following only covers Oracle/OpenJDK Hotspot:

Recent collectors such as G1, ZGC, Shenandoah are highly integrated where all GC cycles (major/minor would be oversimplifying things here) are managed by code specific to that collector.

Some of the older collectors on the other hand are more modular and allow you to mix and match to some extent. Jon Masamitsu's blog post Our Collectors gives an overview of pre-G1 collectors. Note that some of those have been deprecated in jdk8 and removed in jdk9

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=141049&siteId=1