Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @ 3830:f44782f04dd4
7039627: G1: avoid BOT updates for survivor allocations and dirty survivor regions incrementally
Summary: Refactor the allocation code during GC to use the G1AllocRegion abstraction. Use separate subclasses of G1AllocRegion for survivor and old regions. Avoid BOT updates and dirty survivor cards incrementally for the former.
Reviewed-by: brutisso, johnc, ysr
author | tonyp |
---|---|
date | Fri, 12 Aug 2011 11:31:06 -0400 |
parents | 14a2fd14c0db |
children | ff53346271fe |
comparison
equal
deleted
inserted
replaced
3829:87e40b34bc2b | 3830:f44782f04dd4 |
---|---|
857 _survivor_surv_rate_group->reset(); | 857 _survivor_surv_rate_group->reset(); |
858 calculate_young_list_min_length(); | 858 calculate_young_list_min_length(); |
859 calculate_young_list_target_length(); | 859 calculate_young_list_target_length(); |
860 } | 860 } |
861 | 861 |
862 void G1CollectorPolicy::record_before_bytes(size_t bytes) { | |
863 _bytes_in_to_space_before_gc += bytes; | |
864 } | |
865 | |
866 void G1CollectorPolicy::record_after_bytes(size_t bytes) { | |
867 _bytes_in_to_space_after_gc += bytes; | |
868 } | |
869 | |
870 void G1CollectorPolicy::record_stop_world_start() { | 862 void G1CollectorPolicy::record_stop_world_start() { |
871 _stop_world_start = os::elapsedTime(); | 863 _stop_world_start = os::elapsedTime(); |
872 } | 864 } |
873 | 865 |
874 void G1CollectorPolicy::record_collection_pause_start(double start_time_sec, | 866 void G1CollectorPolicy::record_collection_pause_start(double start_time_sec, |
892 _cur_collection_pause_used_at_start_bytes = start_used; | 884 _cur_collection_pause_used_at_start_bytes = start_used; |
893 _cur_collection_pause_used_regions_at_start = _g1->used_regions(); | 885 _cur_collection_pause_used_regions_at_start = _g1->used_regions(); |
894 _pending_cards = _g1->pending_card_num(); | 886 _pending_cards = _g1->pending_card_num(); |
895 _max_pending_cards = _g1->max_pending_card_num(); | 887 _max_pending_cards = _g1->max_pending_card_num(); |
896 | 888 |
897 _bytes_in_to_space_before_gc = 0; | |
898 _bytes_in_to_space_after_gc = 0; | |
899 _bytes_in_collection_set_before_gc = 0; | 889 _bytes_in_collection_set_before_gc = 0; |
890 _bytes_copied_during_gc = 0; | |
900 | 891 |
901 YoungList* young_list = _g1->young_list(); | 892 YoungList* young_list = _g1->young_list(); |
902 _eden_bytes_before_gc = young_list->eden_used_bytes(); | 893 _eden_bytes_before_gc = young_list->eden_used_bytes(); |
903 _survivor_bytes_before_gc = young_list->survivor_used_bytes(); | 894 _survivor_bytes_before_gc = young_list->survivor_used_bytes(); |
904 _capacity_before_gc = _g1->capacity(); | 895 _capacity_before_gc = _g1->capacity(); |
1576 (young_other_time_ms + non_young_other_time_ms); | 1567 (young_other_time_ms + non_young_other_time_ms); |
1577 _constant_other_time_ms_seq->add(constant_other_time_ms); | 1568 _constant_other_time_ms_seq->add(constant_other_time_ms); |
1578 | 1569 |
1579 double survival_ratio = 0.0; | 1570 double survival_ratio = 0.0; |
1580 if (_bytes_in_collection_set_before_gc > 0) { | 1571 if (_bytes_in_collection_set_before_gc > 0) { |
1581 survival_ratio = (double) bytes_in_to_space_during_gc() / | 1572 survival_ratio = (double) _bytes_copied_during_gc / |
1582 (double) _bytes_in_collection_set_before_gc; | 1573 (double) _bytes_in_collection_set_before_gc; |
1583 } | 1574 } |
1584 | 1575 |
1585 _pending_cards_seq->add((double) _pending_cards); | 1576 _pending_cards_seq->add((double) _pending_cards); |
1586 _scanned_cards_seq->add((double) cards_scanned); | 1577 _scanned_cards_seq->add((double) cards_scanned); |
1587 _rs_lengths_seq->add((double) _max_rs_lengths); | 1578 _rs_lengths_seq->add((double) _max_rs_lengths); |