提交 ceaf551e 编写于 作者: J johnc

8006894: G1: Number of marking threads missing from PrintFlagsFinal output

Summary: Set ConcGCThreads to the calculated number of marking threads.
Reviewed-by: jmasa, ysr
上级 53f8cf16
...@@ -571,19 +571,14 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs) : ...@@ -571,19 +571,14 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs) :
_sleep_factor = 0.0; _sleep_factor = 0.0;
_marking_task_overhead = 1.0; _marking_task_overhead = 1.0;
} else { } else {
if (ConcGCThreads > 0) { if (!FLAG_IS_DEFAULT(ConcGCThreads) && ConcGCThreads > 0) {
// notice that ConcGCThreads overwrites G1MarkingOverheadPercent // Note: ConcGCThreads has precedence over G1MarkingOverheadPercent
// if both are set // if both are set
_parallel_marking_threads = (uint) ConcGCThreads;
_max_parallel_marking_threads = _parallel_marking_threads;
_sleep_factor = 0.0; _sleep_factor = 0.0;
_marking_task_overhead = 1.0; _marking_task_overhead = 1.0;
} else if (G1MarkingOverheadPercent > 0) { } else if (G1MarkingOverheadPercent > 0) {
// we will calculate the number of parallel marking threads // We will calculate the number of parallel marking threads based
// based on a target overhead with respect to the soft real-time // on a target overhead with respect to the soft real-time goal
// goal
double marking_overhead = (double) G1MarkingOverheadPercent / 100.0; double marking_overhead = (double) G1MarkingOverheadPercent / 100.0;
double overall_cm_overhead = double overall_cm_overhead =
(double) MaxGCPauseMillis * marking_overhead / (double) MaxGCPauseMillis * marking_overhead /
...@@ -596,17 +591,22 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs) : ...@@ -596,17 +591,22 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs) :
double sleep_factor = double sleep_factor =
(1.0 - marking_task_overhead) / marking_task_overhead; (1.0 - marking_task_overhead) / marking_task_overhead;
_parallel_marking_threads = (uint) marking_thread_num; FLAG_SET_ERGO(uintx, ConcGCThreads, (uint) marking_thread_num);
_max_parallel_marking_threads = _parallel_marking_threads;
_sleep_factor = sleep_factor; _sleep_factor = sleep_factor;
_marking_task_overhead = marking_task_overhead; _marking_task_overhead = marking_task_overhead;
} else { } else {
_parallel_marking_threads = scale_parallel_threads((uint)ParallelGCThreads); // Calculate the number of parallel marking threads by scaling
_max_parallel_marking_threads = _parallel_marking_threads; // the number of parallel GC threads.
uint marking_thread_num = scale_parallel_threads((uint) ParallelGCThreads);
FLAG_SET_ERGO(uintx, ConcGCThreads, marking_thread_num);
_sleep_factor = 0.0; _sleep_factor = 0.0;
_marking_task_overhead = 1.0; _marking_task_overhead = 1.0;
} }
assert(ConcGCThreads > 0, "Should have been set");
_parallel_marking_threads = (uint) ConcGCThreads;
_max_parallel_marking_threads = _parallel_marking_threads;
if (parallel_marking_threads() > 1) { if (parallel_marking_threads() > 1) {
_cleanup_task_overhead = 1.0; _cleanup_task_overhead = 1.0;
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册