1

Currently I am using a combination of CMS and ParNewGC

-XX:+UseConcMarkSweepGC -XX:+UseParNewGC

As per my understanding, CMS is used for Old Gen GC and UserPareNewGC used for you gen garbage collection.

If I pass only CMS as single parameter, -XX:+UseConcMarkSweepGC, is CMS used for garbage collection of both young gen and Old Gen?

I think that UseParNewGC still used for young gen even though it has not been configured along with CMS. But I want to confirm the assumption.

Am I right?

EDIT: I am using JDK 1.7 version. If behaviour is different in 1.7 and 1.8, please explain.

trincot
  • 317,000
  • 35
  • 244
  • 286
Ravindra babu
  • 37,698
  • 11
  • 250
  • 211

2 Answers2

1

When asking gc questions you should state what version of the jdk you are wondering about since the actual combination varies from version to version. But, CMS is only used with tenured generation, never with young generation. Parallell New Gen scavenge will be used.

Erik
  • 2,013
  • 11
  • 17
1

I think that UseParNewGC still used for young gen even though it has not been configured along with CMS. But I want to confirm the assumption.

You can always determine the effective flags by appending -XX:+PrintFlagsFinal to the command line.

This will allow you to determine whether changing flag A will influence flag B.

the8472
  • 40,999
  • 5
  • 70
  • 122
  • I have added above flag but I did not get any concrete proof on which algorithm is executed - [Parallel Time: 168.2 ms, GC Workers: 23] [GC Worker Start (ms): Min: 82247.9, Avg: 82254.2, Max: 82256.4, Diff: 8.5] [Ext Root Scanning (ms): Min: 17.4, Avg: 21.7, Max: 27.6, Diff: 10.2, Sum: 498.2] [Update RS (ms): Min: 0.0, Avg: 0.7, Max: 4.4, Diff: 4.4, Sum: 15.1] [Processed Buffers: Min: 0, Avg: 4.8, Max: 30, Diff: 30, Sum: 110] [Scan RS (ms): Min: 0.2, Avg: 0.4, Max: 1.5, Diff: 1.3, Sum: 9.1] – Ravindra babu Nov 26 '15 at 12:40
  • diff the console output of `java -XX:+UseConcMarkSweepGC -XX:+PrintFlagsFinal` and `java -XX:+PrintFlagsFinal` – the8472 Nov 26 '15 at 19:38