src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hs-gc-g1-gc-timestamp Sdiff src/share/vm/gc_implementation/concurrentMarkSweep

src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp

Print this page
rev 3618 : 7198130: G1: PrintReferenceGC output comes out of order
Summary: Move the first part of the GC logging, including timestamp, to the start of the GC
Reviewed-by: johnc


3408   if (PrintCMSStatistics != 0) {
3409     _collector->resetYields();
3410   }
3411   if (PrintGCDetails && PrintGCTimeStamps) {
3412     gclog_or_tty->date_stamp(PrintGCDateStamps);
3413     gclog_or_tty->stamp();
3414     gclog_or_tty->print_cr(": [%s-concurrent-%s-start]",
3415       _collector->cmsGen()->short_name(), _phase);
3416   }
3417   _collector->resetTimer();
3418   _wallclock.start();
3419   _collector->startTimer();
3420 }
3421 
3422 CMSPhaseAccounting::~CMSPhaseAccounting() {
3423   assert(_wallclock.is_active(), "Wall clock should not have stopped");
3424   _collector->stopTimer();
3425   _wallclock.stop();
3426   if (PrintGCDetails) {
3427     gclog_or_tty->date_stamp(PrintGCDateStamps);
3428     if (PrintGCTimeStamps) {
3429       gclog_or_tty->stamp();
3430       gclog_or_tty->print(": ");
3431     }
3432     gclog_or_tty->print("[%s-concurrent-%s: %3.3f/%3.3f secs]",
3433                  _collector->cmsGen()->short_name(),
3434                  _phase, _collector->timerValue(), _wallclock.seconds());
3435     if (_print_cr) {
3436       gclog_or_tty->print_cr("");
3437     }
3438     if (PrintCMSStatistics != 0) {
3439       gclog_or_tty->print_cr(" (CMS-concurrent-%s yielded %d times)", _phase,
3440                     _collector->yields());
3441     }
3442   }
3443 }
3444 
3445 // CMS work
3446 
3447 // Checkpoint the roots into this generation from outside
3448 // this generation. [Note this initial checkpoint need only
3449 // be approximate -- we'll do a catch up phase subsequently.]
3450 void CMSCollector::checkpointRootsInitial(bool asynch) {
3451   assert(_collectorState == InitialMarking, "Wrong collector state");




3408   if (PrintCMSStatistics != 0) {
3409     _collector->resetYields();
3410   }
3411   if (PrintGCDetails && PrintGCTimeStamps) {
3412     gclog_or_tty->date_stamp(PrintGCDateStamps);
3413     gclog_or_tty->stamp();
3414     gclog_or_tty->print_cr(": [%s-concurrent-%s-start]",
3415       _collector->cmsGen()->short_name(), _phase);
3416   }
3417   _collector->resetTimer();
3418   _wallclock.start();
3419   _collector->startTimer();
3420 }
3421 
3422 CMSPhaseAccounting::~CMSPhaseAccounting() {
3423   assert(_wallclock.is_active(), "Wall clock should not have stopped");
3424   _collector->stopTimer();
3425   _wallclock.stop();
3426   if (PrintGCDetails) {
3427     gclog_or_tty->date_stamp(PrintGCDateStamps);
3428     gclog_or_tty->stamp(PrintGCTimeStamps);



3429     gclog_or_tty->print("[%s-concurrent-%s: %3.3f/%3.3f secs]",
3430                  _collector->cmsGen()->short_name(),
3431                  _phase, _collector->timerValue(), _wallclock.seconds());
3432     if (_print_cr) {
3433       gclog_or_tty->print_cr("");
3434     }
3435     if (PrintCMSStatistics != 0) {
3436       gclog_or_tty->print_cr(" (CMS-concurrent-%s yielded %d times)", _phase,
3437                     _collector->yields());
3438     }
3439   }
3440 }
3441 
3442 // CMS work
3443 
3444 // Checkpoint the roots into this generation from outside
3445 // this generation. [Note this initial checkpoint need only
3446 // be approximate -- we'll do a catch up phase subsequently.]
3447 void CMSCollector::checkpointRootsInitial(bool asynch) {
3448   assert(_collectorState == InitialMarking, "Wrong collector state");


src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File