--- old/src/share/vm/memory/genCollectedHeap.cpp 2012-05-07 14:09:58.615351200 +0200 +++ new/src/share/vm/memory/genCollectedHeap.cpp 2012-05-07 14:09:54.855744600 +0200 @@ -480,9 +480,6 @@ const size_t perm_prev_used = perm_gen()->used(); print_heap_before_gc(); - if (Verbose) { - gclog_or_tty->print_cr("GC Cause: %s", GCCause::to_string(gc_cause())); - } { FlagSetting fl(_is_gc_active, true); @@ -490,12 +487,10 @@ bool complete = full && (max_level == (n_gens()-1)); const char* gc_cause_str = "GC "; if (complete) { - GCCause::Cause cause = gc_cause(); - if (cause == GCCause::_java_lang_system_gc) { - gc_cause_str = "Full GC (System) "; - } else { - gc_cause_str = "Full GC "; - } + char gc_cause_str[128]; + sprintf(gc_cause_str, "Full GC (%s)", GCCause::to_string(gc_cause())); + } else if (Verbose) { + gclog_or_tty->print_cr("GC Cause: %s", GCCause::to_string(gc_cause())); } gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps); TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); --- old/src/share/vm/memory/genMarkSweep.cpp 2012-05-07 14:09:58.615351200 +0200 +++ new/src/share/vm/memory/genMarkSweep.cpp 2012-05-07 14:09:54.855744600 +0200 @@ -76,7 +76,9 @@ _ref_processor = rp; rp->setup_policy(clear_all_softrefs); - TraceTime t1("Full GC", PrintGC && !PrintGCDetails, true, gclog_or_tty); + char gc_cause_str[128]; + sprintf(gc_cause_str, "Full GC (%s)", GCCause::to_string(gch->gc_cause())); + TraceTime t1(gc_cause_str, PrintGC && !PrintGCDetails, true, gclog_or_tty); // When collecting the permanent generation methodOops may be moving, // so we either have to flush all bcp data or convert it into bci. --- old/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 2012-05-07 14:09:58.630951200 +0200 +++ new/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 2012-05-07 14:09:54.824544600 +0200 @@ -2047,14 +2047,9 @@ gc_task_manager()->task_idle_workers(); heap->set_par_threads(gc_task_manager()->active_workers()); - const bool is_system_gc = gc_cause == GCCause::_java_lang_system_gc; + char gc_cause_str[128]; + sprintf(gc_cause_str, "Full GC (%s)", GCCause::to_string(gc_cause)); - // This is useful for debugging but don't change the output the - // the customer sees. - const char* gc_cause_str = "Full GC"; - if (is_system_gc && PrintGCDetails) { - gc_cause_str = "Full GC (System)"; - } gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps); TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); TraceTime t1(gc_cause_str, PrintGC, !PrintGCDetails, gclog_or_tty); @@ -2090,7 +2085,8 @@ } #endif // #ifndef PRODUCT - bool max_on_system_gc = UseMaximumCompactionOnSystemGC && is_system_gc; + bool max_on_system_gc = UseMaximumCompactionOnSystemGC + && gc_cause == GCCause::_java_lang_system_gc; summary_phase(vmthread_cm, maximum_heap_compaction || max_on_system_gc); COMPILER2_PRESENT(assert(DerivedPointerTable::is_active(), "Sanity")); --- old/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp 2012-05-07 14:09:58.630951200 +0200 +++ new/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp 2012-05-07 14:09:54.824544600 +0200 @@ -160,13 +160,9 @@ { HandleMark hm; - const bool is_system_gc = gc_cause == GCCause::_java_lang_system_gc; - // This is useful for debugging but don't change the output the - // the customer sees. - const char* gc_cause_str = "Full GC"; - if (is_system_gc && PrintGCDetails) { - gc_cause_str = "Full GC (System)"; - } + char gc_cause_str[128]; + sprintf(gc_cause_str, "Full GC (%s)", GCCause::to_string(gc_cause)); + gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps); TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); TraceTime t1(gc_cause_str, PrintGC, !PrintGCDetails, gclog_or_tty);