what's the difference between ParallelGC and ParallelOldGC?

leo picture leo · Jun 4, 2011 · Viewed 32.3k times · Source

I have some questions about the GC Algorithm: First when we use the parameters such UseSerialGC, UseParallelGC, UseParallelOldGC and so on, we specify a GC Algorithm. Each of them all can do GC in all generation, is it right?

For example, if I use java -XX:+UseSerialGC, all generation will use serial GC as the GC Algorithm.

Second can I use ParallelGC in Old Gneneration and use SerialGC in young generation?

The last as the title what's the difference between ParallelGC and ParallelOldGC?

Answer

Pavan picture Pavan · Jun 4, 2011

Take a look at the HotSpot VM Options:

-XX:+UseParallelGC = Use parallel garbage collection for scavenges. (Introduced in 1.4.1).

-XX:+UseParallelOldGC = Use parallel garbage collection for the full collections. Enabling this option automatically sets -XX:+UseParallelGC. (Introduced in 5.0 update 6.)

where Scavenges = Young generation GC.