--- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2012-05-08 16:12:35.675445600 +0200 +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2012-05-08 16:12:33.182303000 +0200 @@ -1252,10 +1252,7 @@ gclog_or_tty->date_stamp(G1Log::fine() && PrintGCDateStamps); TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty); - char verbose_str[128]; - sprintf(verbose_str, "Full GC (%s)", GCCause::to_string(gc_cause())); - TraceTime t(verbose_str, G1Log::fine(), true, gclog_or_tty); - + TraceTime t(GCCauseString("Full GC", gc_cause()), G1Log::fine(), true, gclog_or_tty); TraceCollectorStats tcs(g1mm()->full_collection_counters()); TraceMemoryManagerStats tms(true /* fullGC */, gc_cause()); @@ -3600,12 +3597,11 @@ gclog_or_tty->date_stamp(G1Log::fine() && PrintGCDateStamps); TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty); - char verbose_str[128]; - sprintf(verbose_str, "GC pause (%s) (%s)%s", - GCCause::to_string(gc_cause()), - g1_policy()->gcs_are_young() ? "young" : "mixed", - g1_policy()->during_initial_mark_pause() ? " (initial-mark)" : ""); - TraceTime t(verbose_str, G1Log::fine() && !G1Log::finer(), true, gclog_or_tty); + TraceTime t(GCCauseString("GC pause", gc_cause()) + .append(g1_policy()->gcs_are_young() ? " (young)" : " (mixed)") + .append(g1_policy()->during_initial_mark_pause() ? " (initial-mark)" : ""), + G1Log::fine() && !G1Log::finer(), + true, gclog_or_tty); TraceCollectorStats tcs(g1mm()->incremental_collection_counters()); TraceMemoryManagerStats tms(false /* fullGC */, gc_cause());