Mercurial > hg > graal-jvmci-8
comparison src/share/vm/memory/genCollectedHeap.cpp @ 6064:9d679effd28c
7166894: Add gc cause to GC logging for all collectors
Reviewed-by: mgerdin, johnc
author | brutisso |
---|---|
date | Tue, 15 May 2012 10:25:06 +0200 |
parents | b632e80fc9dc |
children | bbc900c2482a |
comparison
equal
deleted
inserted
replaced
6063:cdfa5139bd58 | 6064:9d679effd28c |
---|---|
478 ClearedAllSoftRefs casr(do_clear_all_soft_refs, collector_policy()); | 478 ClearedAllSoftRefs casr(do_clear_all_soft_refs, collector_policy()); |
479 | 479 |
480 const size_t perm_prev_used = perm_gen()->used(); | 480 const size_t perm_prev_used = perm_gen()->used(); |
481 | 481 |
482 print_heap_before_gc(); | 482 print_heap_before_gc(); |
483 if (Verbose) { | |
484 gclog_or_tty->print_cr("GC Cause: %s", GCCause::to_string(gc_cause())); | |
485 } | |
486 | 483 |
487 { | 484 { |
488 FlagSetting fl(_is_gc_active, true); | 485 FlagSetting fl(_is_gc_active, true); |
489 | 486 |
490 bool complete = full && (max_level == (n_gens()-1)); | 487 bool complete = full && (max_level == (n_gens()-1)); |
491 const char* gc_cause_str = "GC "; | 488 const char* gc_cause_prefix = complete ? "Full GC" : "GC"; |
492 if (complete) { | |
493 GCCause::Cause cause = gc_cause(); | |
494 if (cause == GCCause::_java_lang_system_gc) { | |
495 gc_cause_str = "Full GC (System) "; | |
496 } else { | |
497 gc_cause_str = "Full GC "; | |
498 } | |
499 } | |
500 gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps); | 489 gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps); |
501 TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); | 490 TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); |
502 TraceTime t(gc_cause_str, PrintGCDetails, false, gclog_or_tty); | 491 TraceTime t(GCCauseString(gc_cause_prefix, gc_cause()), PrintGCDetails, false, gclog_or_tty); |
503 | 492 |
504 gc_prologue(complete); | 493 gc_prologue(complete); |
505 increment_total_collections(complete); | 494 increment_total_collections(complete); |
506 | 495 |
507 size_t gch_prev_used = used(); | 496 size_t gch_prev_used = used(); |