Print this page
rev 3856 : 8004170: G1: Verbose GC output is not getting flushed to log file using JDK 8
Summary: Add flushes to G1CollectedHeap::log_gc_footer() and TraceCPUTime destructor.
Reviewed-by:

Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
          +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
↓ open down ↓ 3682 lines elided ↑ open up ↑
3683 3683      g1_policy()->phase_times()->note_gc_end();
3684 3684      g1_policy()->phase_times()->print(pause_time_sec);
3685 3685      g1_policy()->print_detailed_heap_transition();
3686 3686    } else {
3687 3687      if (evacuation_failed()) {
3688 3688        gclog_or_tty->print("--");
3689 3689      }
3690 3690      g1_policy()->print_heap_transition();
3691 3691      gclog_or_tty->print_cr(", %3.7f secs]", pause_time_sec);
3692 3692    }
     3693 +  gclog_or_tty->flush();
3693 3694  }
3694 3695  
3695 3696  bool
3696 3697  G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
3697 3698    assert_at_safepoint(true /* should_be_vm_thread */);
3698 3699    guarantee(!is_gc_active(), "collection is not reentrant");
3699 3700  
3700 3701    if (GC_locker::check_active_before_gc()) {
3701 3702      return false;
3702 3703    }
↓ open down ↓ 326 lines elided ↑ open up ↑
4029 4030  
4030 4031        if (mark_in_progress()) {
4031 4032          concurrent_mark()->update_g1_committed();
4032 4033        }
4033 4034  
4034 4035  #ifdef TRACESPINNING
4035 4036        ParallelTaskTerminator::print_termination_counts();
4036 4037  #endif
4037 4038  
4038 4039        gc_epilogue(false);
4039      -
4040      -      log_gc_footer(os::elapsedTime() - pause_start_sec);
4041 4040      }
4042 4041  
     4042 +    // Print the remainder of the GC log output.
     4043 +    log_gc_footer(os::elapsedTime() - pause_start_sec);
     4044 +
4043 4045      // It is not yet to safe to tell the concurrent mark to
4044 4046      // start as we have some optional output below. We don't want the
4045 4047      // output from the concurrent mark thread interfering with this
4046 4048      // logging output either.
4047 4049  
4048 4050      _hrs.verify_optional();
4049 4051      verify_region_sets_optional();
4050 4052  
4051 4053      TASKQUEUE_STATS_ONLY(if (ParallelGCVerbose) print_taskqueue_stats());
4052 4054      TASKQUEUE_STATS_ONLY(reset_taskqueue_stats());
↓ open down ↓ 2413 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX