src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp
Print this page
rev 2896 : 6484965: G1: piggy-back liveness accounting phase on marking
Summary: Remove the separate counting phase of concurrent marking by tracking the amount of marked bytes and the cards spanned by marked objects in marking task/worker thread local data structures, which are updated as individual objects are marked.
Reviewed-by: brutisso
*** 42,53 ****
ConcurrentGCThread(),
_cm(cm),
_started(false),
_in_progress(false),
_vtime_accum(0.0),
! _vtime_mark_accum(0.0),
! _vtime_count_accum(0.0)
{
create_and_start();
}
class CMCheckpointRootsFinalClosure: public VoidClosure {
--- 42,52 ----
ConcurrentGCThread(),
_cm(cm),
_started(false),
_in_progress(false),
_vtime_accum(0.0),
! _vtime_mark_accum(0.0)
{
create_and_start();
}
class CMCheckpointRootsFinalClosure: public VoidClosure {
*** 146,185 ****
gclog_or_tty->print_cr("[GC concurrent-mark-restart-for-overflow]");
}
}
} while (cm()->restart_for_overflow());
- double counting_start_time = os::elapsedVTime();
- if (!cm()->has_aborted()) {
- double count_start_sec = os::elapsedTime();
- if (PrintGC) {
- gclog_or_tty->date_stamp(PrintGCDateStamps);
- gclog_or_tty->stamp(PrintGCTimeStamps);
- gclog_or_tty->print_cr("[GC concurrent-count-start]");
- }
-
- _sts.join();
- _cm->calcDesiredRegions();
- _sts.leave();
-
- if (!cm()->has_aborted()) {
- double count_end_sec = os::elapsedTime();
- if (PrintGC) {
- gclog_or_tty->date_stamp(PrintGCDateStamps);
- gclog_or_tty->stamp(PrintGCTimeStamps);
- gclog_or_tty->print_cr("[GC concurrent-count-end, %1.7lf]",
- count_end_sec - count_start_sec);
- }
- }
- }
-
double end_time = os::elapsedVTime();
- _vtime_count_accum += (end_time - counting_start_time);
// Update the total virtual time before doing this, since it will try
// to measure it to get the vtime for this marking. We purposely
// neglect the presumably-short "completeCleanup" phase here.
_vtime_accum = (end_time - _vtime_start);
if (!cm()->has_aborted()) {
if (g1_policy->adaptive_young_list_length()) {
double now = os::elapsedTime();
double cleanup_prediction_ms = g1_policy->predict_cleanup_time_ms();
jlong sleep_time_ms = mmu_tracker->when_ms(now, cleanup_prediction_ms);
--- 145,160 ----
gclog_or_tty->print_cr("[GC concurrent-mark-restart-for-overflow]");
}
}
} while (cm()->restart_for_overflow());
double end_time = os::elapsedVTime();
// Update the total virtual time before doing this, since it will try
// to measure it to get the vtime for this marking. We purposely
// neglect the presumably-short "completeCleanup" phase here.
_vtime_accum = (end_time - _vtime_start);
+
if (!cm()->has_aborted()) {
if (g1_policy->adaptive_young_list_length()) {
double now = os::elapsedTime();
double cleanup_prediction_ms = g1_policy->predict_cleanup_time_ms();
jlong sleep_time_ms = mmu_tracker->when_ms(now, cleanup_prediction_ms);