comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 3980:8229bd737950

7075646: G1: fix inconsistencies in the monitoring data Summary: Fixed a few inconsistencies in the monitoring data, in particular when reported from jstat. Reviewed-by: jmasa, brutisso, johnc
author tonyp
date Fri, 23 Sep 2011 16:07:49 -0400
parents 4dfb2df418f2
children 273b46400613
comparison
equal deleted inserted replaced
3979:4dfb2df418f2 3980:8229bd737950
814 HeapWord* result = NULL; 814 HeapWord* result = NULL;
815 if (first != G1_NULL_HRS_INDEX) { 815 if (first != G1_NULL_HRS_INDEX) {
816 result = 816 result =
817 humongous_obj_allocate_initialize_regions(first, num_regions, word_size); 817 humongous_obj_allocate_initialize_regions(first, num_regions, word_size);
818 assert(result != NULL, "it should always return a valid result"); 818 assert(result != NULL, "it should always return a valid result");
819
820 // A successful humongous object allocation changes the used space
821 // information of the old generation so we need to recalculate the
822 // sizes and update the jstat counters here.
823 g1mm()->update_sizes();
819 } 824 }
820 825
821 verify_region_sets_optional(); 826 verify_region_sets_optional();
822 827
823 return result; 828 return result;
1420 verify_region_sets_optional(); 1425 verify_region_sets_optional();
1421 1426
1422 if (PrintHeapAtGC) { 1427 if (PrintHeapAtGC) {
1423 Universe::print_heap_after_gc(); 1428 Universe::print_heap_after_gc();
1424 } 1429 }
1425 g1mm()->update_counters(); 1430 g1mm()->update_sizes();
1426 post_full_gc_dump(); 1431 post_full_gc_dump();
1427 1432
1428 return true; 1433 return true;
1429 } 1434 }
1430 1435
1788 _bot_shared(NULL), 1793 _bot_shared(NULL),
1789 _objs_with_preserved_marks(NULL), _preserved_marks_of_objs(NULL), 1794 _objs_with_preserved_marks(NULL), _preserved_marks_of_objs(NULL),
1790 _evac_failure_scan_stack(NULL) , 1795 _evac_failure_scan_stack(NULL) ,
1791 _mark_in_progress(false), 1796 _mark_in_progress(false),
1792 _cg1r(NULL), _summary_bytes_used(0), 1797 _cg1r(NULL), _summary_bytes_used(0),
1798 _g1mm(NULL),
1793 _refine_cte_cl(NULL), 1799 _refine_cte_cl(NULL),
1794 _full_collection(false), 1800 _full_collection(false),
1795 _free_list("Master Free List"), 1801 _free_list("Master Free List"),
1796 _secondary_free_list("Secondary Free List"), 1802 _secondary_free_list("Secondary Free List"),
1797 _humongous_set("Master Humongous Set"), 1803 _humongous_set("Master Humongous Set"),
2067 2073
2068 init_mutator_alloc_region(); 2074 init_mutator_alloc_region();
2069 2075
2070 // Do create of the monitoring and management support so that 2076 // Do create of the monitoring and management support so that
2071 // values in the heap have been properly initialized. 2077 // values in the heap have been properly initialized.
2072 _g1mm = new G1MonitoringSupport(this, &_g1_storage); 2078 _g1mm = new G1MonitoringSupport(this);
2073 2079
2074 return JNI_OK; 2080 return JNI_OK;
2075 } 2081 }
2076 2082
2077 void G1CollectedHeap::ref_processing_init() { 2083 void G1CollectedHeap::ref_processing_init() {
3700 TASKQUEUE_STATS_ONLY(reset_taskqueue_stats()); 3706 TASKQUEUE_STATS_ONLY(reset_taskqueue_stats());
3701 3707
3702 if (PrintHeapAtGC) { 3708 if (PrintHeapAtGC) {
3703 Universe::print_heap_after_gc(); 3709 Universe::print_heap_after_gc();
3704 } 3710 }
3705 g1mm()->update_counters(); 3711 g1mm()->update_sizes();
3706 3712
3707 if (G1SummarizeRSetStats && 3713 if (G1SummarizeRSetStats &&
3708 (G1SummarizeRSetStatsPeriod > 0) && 3714 (G1SummarizeRSetStatsPeriod > 0) &&
3709 (total_collections() % G1SummarizeRSetStatsPeriod == 0)) { 3715 (total_collections() % G1SummarizeRSetStatsPeriod == 0)) {
3710 g1_rem_set()->print_summary_info(); 3716 g1_rem_set()->print_summary_info();
5813 false /* do_expand */); 5819 false /* do_expand */);
5814 if (new_alloc_region != NULL) { 5820 if (new_alloc_region != NULL) {
5815 g1_policy()->update_region_num(true /* next_is_young */); 5821 g1_policy()->update_region_num(true /* next_is_young */);
5816 set_region_short_lived_locked(new_alloc_region); 5822 set_region_short_lived_locked(new_alloc_region);
5817 _hr_printer.alloc(new_alloc_region, G1HRPrinter::Eden, young_list_full); 5823 _hr_printer.alloc(new_alloc_region, G1HRPrinter::Eden, young_list_full);
5818 g1mm()->update_eden_counters();
5819 return new_alloc_region; 5824 return new_alloc_region;
5820 } 5825 }
5821 } 5826 }
5822 return NULL; 5827 return NULL;
5823 } 5828 }
5828 assert(alloc_region->is_young(), "all mutator alloc regions should be young"); 5833 assert(alloc_region->is_young(), "all mutator alloc regions should be young");
5829 5834
5830 g1_policy()->add_region_to_incremental_cset_lhs(alloc_region); 5835 g1_policy()->add_region_to_incremental_cset_lhs(alloc_region);
5831 _summary_bytes_used += allocated_bytes; 5836 _summary_bytes_used += allocated_bytes;
5832 _hr_printer.retire(alloc_region); 5837 _hr_printer.retire(alloc_region);
5838 // We update the eden sizes here, when the region is retired,
5839 // instead of when it's allocated, since this is the point that its
5840 // used space has been recored in _summary_bytes_used.
5841 g1mm()->update_eden_size();
5833 } 5842 }
5834 5843
5835 HeapRegion* MutatorAllocRegion::allocate_new_region(size_t word_size, 5844 HeapRegion* MutatorAllocRegion::allocate_new_region(size_t word_size,
5836 bool force) { 5845 bool force) {
5837 return _g1h->new_mutator_alloc_region(word_size, force); 5846 return _g1h->new_mutator_alloc_region(word_size, force);