src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp

changeset 3269
53074c2c4600
parent 3268
8aae2050e83e
child 3289
a88de71c4e3a
equal deleted inserted replaced
3268:8aae2050e83e 3269:53074c2c4600
3004 if (!silent) gclog_or_tty->print("RemSet "); 3004 if (!silent) gclog_or_tty->print("RemSet ");
3005 rem_set()->verify(); 3005 rem_set()->verify();
3006 3006
3007 if (failures) { 3007 if (failures) {
3008 gclog_or_tty->print_cr("Heap:"); 3008 gclog_or_tty->print_cr("Heap:");
3009 print_on(gclog_or_tty, true /* extended */); 3009 // It helps to have the per-region information in the output to
3010 // help us track down what went wrong. This is why we call
3011 // print_extended_on() instead of print_on().
3012 print_extended_on(gclog_or_tty);
3010 gclog_or_tty->print_cr(""); 3013 gclog_or_tty->print_cr("");
3011 #ifndef PRODUCT 3014 #ifndef PRODUCT
3012 if (VerifyDuringGC && G1VerifyDuringGCPrintReachable) { 3015 if (VerifyDuringGC && G1VerifyDuringGCPrintReachable) {
3013 concurrent_mark()->print_reachable("at-verification-failure", 3016 concurrent_mark()->print_reachable("at-verification-failure",
3014 vo, false /* all */); 3017 vo, false /* all */);
3030 r->print_on(_st); 3033 r->print_on(_st);
3031 return false; 3034 return false;
3032 } 3035 }
3033 }; 3036 };
3034 3037
3035 void G1CollectedHeap::print() const { print_on(tty); }
3036
3037 void G1CollectedHeap::print_on(outputStream* st) const { 3038 void G1CollectedHeap::print_on(outputStream* st) const {
3038 print_on(st, PrintHeapAtGCExtended);
3039 }
3040
3041 void G1CollectedHeap::print_on(outputStream* st, bool extended) const {
3042 st->print(" %-20s", "garbage-first heap"); 3039 st->print(" %-20s", "garbage-first heap");
3043 st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", 3040 st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K",
3044 capacity()/K, used_unlocked()/K); 3041 capacity()/K, used_unlocked()/K);
3045 st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", 3042 st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")",
3046 _g1_storage.low_boundary(), 3043 _g1_storage.low_boundary(),
3054 size_t survivor_regions = g1_policy()->recorded_survivor_regions(); 3051 size_t survivor_regions = g1_policy()->recorded_survivor_regions();
3055 st->print(SIZE_FORMAT " survivors (" SIZE_FORMAT "K)", 3052 st->print(SIZE_FORMAT " survivors (" SIZE_FORMAT "K)",
3056 survivor_regions, survivor_regions * HeapRegion::GrainBytes / K); 3053 survivor_regions, survivor_regions * HeapRegion::GrainBytes / K);
3057 st->cr(); 3054 st->cr();
3058 perm()->as_gen()->print_on(st); 3055 perm()->as_gen()->print_on(st);
3059 if (extended) { 3056 }
3060 st->cr(); 3057
3061 print_on_extended(st); 3058 void G1CollectedHeap::print_extended_on(outputStream* st) const {
3062 } 3059 print_on(st);
3063 } 3060
3064 3061 // Print the per-region information.
3065 void G1CollectedHeap::print_on_extended(outputStream* st) const { 3062 st->cr();
3063 st->print_cr("Heap Regions: (Y=young(eden), SU=young(survivor), HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TS=gc time stamp, PTAMS=previous top-at-mark-start, NTAMS=next top-at-mark-start)");
3066 PrintRegionClosure blk(st); 3064 PrintRegionClosure blk(st);
3067 heap_region_iterate(&blk); 3065 heap_region_iterate(&blk);
3068 } 3066 }
3069 3067
3070 void G1CollectedHeap::print_gc_threads_on(outputStream* st) const { 3068 void G1CollectedHeap::print_gc_threads_on(outputStream* st) const {

mercurial