2387 (size_t) young_regions * HeapRegion::GrainBytes / K); |
2387 (size_t) young_regions * HeapRegion::GrainBytes / K); |
2388 uint survivor_regions = survivor_regions_count(); |
2388 uint survivor_regions = survivor_regions_count(); |
2389 st->print("%u survivors (" SIZE_FORMAT "K)", survivor_regions, |
2389 st->print("%u survivors (" SIZE_FORMAT "K)", survivor_regions, |
2390 (size_t) survivor_regions * HeapRegion::GrainBytes / K); |
2390 (size_t) survivor_regions * HeapRegion::GrainBytes / K); |
2391 st->cr(); |
2391 st->cr(); |
|
2392 if (_numa->is_enabled()) { |
|
2393 uint num_nodes = _numa->num_active_nodes(); |
|
2394 st->print(" remaining free region(s) on each NUMA node: "); |
|
2395 const int* node_ids = _numa->node_ids(); |
|
2396 for (uint node_index = 0; node_index < num_nodes; node_index++) { |
|
2397 st->print("%d=%u ", node_ids[node_index], _hrm->num_free_regions(node_index)); |
|
2398 } |
|
2399 st->cr(); |
|
2400 } |
2392 MetaspaceUtils::print_on(st); |
2401 MetaspaceUtils::print_on(st); |
2393 } |
2402 } |
2394 |
2403 |
2395 void G1CollectedHeap::print_regions_on(outputStream* st) const { |
2404 void G1CollectedHeap::print_regions_on(outputStream* st) const { |
2396 st->print_cr("Heap Regions: E=young(eden), S=young(survivor), O=old, " |
2405 st->print_cr("Heap Regions: E=young(eden), S=young(survivor), O=old, " |
2576 |
2585 |
2577 MemoryService::track_memory_usage(); |
2586 MemoryService::track_memory_usage(); |
2578 // We have just completed a GC. Update the soft reference |
2587 // We have just completed a GC. Update the soft reference |
2579 // policy with the new heap occupancy |
2588 // policy with the new heap occupancy |
2580 Universe::update_heap_info_at_gc(); |
2589 Universe::update_heap_info_at_gc(); |
|
2590 |
|
2591 // Print NUMA statistics. |
|
2592 _numa->print_statistics(); |
|
2593 } |
|
2594 |
|
2595 void G1CollectedHeap::verify_numa_regions(const char* desc) { |
|
2596 LogTarget(Trace, gc, heap, verify) lt; |
|
2597 |
|
2598 if (lt.is_enabled()) { |
|
2599 LogStream ls(lt); |
|
2600 // Iterate all heap regions to print matching between preferred numa id and actual numa id. |
|
2601 G1NodeIndexCheckClosure cl(desc, _numa, &ls); |
|
2602 heap_region_iterate(&cl); |
|
2603 } |
2581 } |
2604 } |
2582 |
2605 |
2583 HeapWord* G1CollectedHeap::do_collection_pause(size_t word_size, |
2606 HeapWord* G1CollectedHeap::do_collection_pause(size_t word_size, |
2584 uint gc_count_before, |
2607 uint gc_count_before, |
2585 bool* succeeded, |
2608 bool* succeeded, |
2885 VerifyRegionRemSetClosure v_cl; |
2908 VerifyRegionRemSetClosure v_cl; |
2886 heap_region_iterate(&v_cl); |
2909 heap_region_iterate(&v_cl); |
2887 } |
2910 } |
2888 _verifier->verify_before_gc(type); |
2911 _verifier->verify_before_gc(type); |
2889 _verifier->check_bitmaps("GC Start"); |
2912 _verifier->check_bitmaps("GC Start"); |
|
2913 verify_numa_regions("GC Start"); |
2890 } |
2914 } |
2891 |
2915 |
2892 void G1CollectedHeap::verify_after_young_collection(G1HeapVerifier::G1VerifyType type) { |
2916 void G1CollectedHeap::verify_after_young_collection(G1HeapVerifier::G1VerifyType type) { |
2893 if (VerifyRememberedSets) { |
2917 if (VerifyRememberedSets) { |
2894 log_info(gc, verify)("[Verifying RemSets after GC]"); |
2918 log_info(gc, verify)("[Verifying RemSets after GC]"); |
2895 VerifyRegionRemSetClosure v_cl; |
2919 VerifyRegionRemSetClosure v_cl; |
2896 heap_region_iterate(&v_cl); |
2920 heap_region_iterate(&v_cl); |
2897 } |
2921 } |
2898 _verifier->verify_after_gc(type); |
2922 _verifier->verify_after_gc(type); |
2899 _verifier->check_bitmaps("GC End"); |
2923 _verifier->check_bitmaps("GC End"); |
|
2924 verify_numa_regions("GC End"); |
2900 } |
2925 } |
2901 |
2926 |
2902 void G1CollectedHeap::expand_heap_after_young_collection(){ |
2927 void G1CollectedHeap::expand_heap_after_young_collection(){ |
2903 size_t expand_bytes = _heap_sizing_policy->expansion_amount(); |
2928 size_t expand_bytes = _heap_sizing_policy->expansion_amount(); |
2904 if (expand_bytes > 0) { |
2929 if (expand_bytes > 0) { |