This simplest way to demonstrate this is to run:
$ java -XX:G1ConcRefinementThreads=1 -XX:+UnlockDiagnosticVMOptions -XX:+G1TraceConcRefinement Hello
G1-Refine-stop
G1-Refine-stop
Those two lines correspond to two separate threads coming to ConcurrentG1RefineThread::stop. I understand this is because of:
// We need one extra thread to do the young gen rset size sampling.
_n_threads = _n_worker_threads + 1;
...but this is not what user supplied for the number of refinement threads. This is at very least confusing, and potentially complicates GC fine-tuning.
$ java -XX:G1ConcRefinementThreads=1 -XX:+UnlockDiagnosticVMOptions -XX:+G1TraceConcRefinement Hello
G1-Refine-stop
G1-Refine-stop
Those two lines correspond to two separate threads coming to ConcurrentG1RefineThread::stop. I understand this is because of:
// We need one extra thread to do the young gen rset size sampling.
_n_threads = _n_worker_threads + 1;
...but this is not what user supplied for the number of refinement threads. This is at very least confusing, and potentially complicates GC fine-tuning.
- duplicates
-
JDK-8138920 Refactor the sampling thread from ConcurrentG1RefineThread
- Resolved