Fri, 30 Nov 2012 11:46:17 -0800
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: jwilhelm, azeemj, brutisso
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/runtime/timer.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Fri Nov 30 17:00:32 2012 -0800 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Fri Nov 30 11:46:17 2012 -0800 1.3 @@ -3690,6 +3690,7 @@ 1.4 g1_policy()->print_heap_transition(); 1.5 gclog_or_tty->print_cr(", %3.7f secs]", pause_time_sec); 1.6 } 1.7 + gclog_or_tty->flush(); 1.8 } 1.9 1.10 bool 1.11 @@ -4036,10 +4037,11 @@ 1.12 #endif 1.13 1.14 gc_epilogue(false); 1.15 - 1.16 - log_gc_footer(os::elapsedTime() - pause_start_sec); 1.17 } 1.18 1.19 + // Print the remainder of the GC log output. 1.20 + log_gc_footer(os::elapsedTime() - pause_start_sec); 1.21 + 1.22 // It is not yet to safe to tell the concurrent mark to 1.23 // start as we have some optional output below. We don't want the 1.24 // output from the concurrent mark thread interfering with this
2.1 --- a/src/share/vm/runtime/timer.cpp Fri Nov 30 17:00:32 2012 -0800 2.2 +++ b/src/share/vm/runtime/timer.cpp Fri Nov 30 11:46:17 2012 -0800 2.3 @@ -210,8 +210,9 @@ 2.4 } else { 2.5 _logfile->print("[Error in TraceCPUTime]"); 2.6 } 2.7 - if (_print_cr) { 2.8 + if (_print_cr) { 2.9 _logfile->print_cr(""); 2.10 } 2.11 + _logfile->flush(); 2.12 } 2.13 }