comparison src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @ 4130:d23d2b18183e

7118202: G1: eden size unnecessarily drops to a minimum Summary: An integer underflow can cause the RSet lengths to be massively overpredicted which forces the eden size to the minimum. Reviewed-by: brutisso, johnc
author tonyp
date Wed, 07 Dec 2011 12:54:51 -0500
parents dc467e8b2c5e
children 41406797186b
comparison
equal deleted inserted replaced
4129:f4414323345f 4130:d23d2b18183e
1547 _fully_young_cards_per_entry_ratio_seq->add(cards_per_entry_ratio); 1547 _fully_young_cards_per_entry_ratio_seq->add(cards_per_entry_ratio);
1548 else 1548 else
1549 _partially_young_cards_per_entry_ratio_seq->add(cards_per_entry_ratio); 1549 _partially_young_cards_per_entry_ratio_seq->add(cards_per_entry_ratio);
1550 } 1550 }
1551 1551
1552 size_t rs_length_diff = _max_rs_lengths - _recorded_rs_lengths; 1552 // It turns out that, sometimes, _max_rs_lengths can get smaller
1553 if (rs_length_diff >= 0) 1553 // than _recorded_rs_lengths which causes rs_length_diff to get
1554 _rs_length_diff_seq->add((double) rs_length_diff); 1554 // very large and mess up the RSet length predictions. We'll be
1555 // defensive until we work out why this happens.
1556 size_t rs_length_diff = 0;
1557 if (_max_rs_lengths > _recorded_rs_lengths) {
1558 rs_length_diff = _max_rs_lengths - _recorded_rs_lengths;
1559 }
1560 _rs_length_diff_seq->add((double) rs_length_diff);
1555 1561
1556 size_t copied_bytes = surviving_bytes; 1562 size_t copied_bytes = surviving_bytes;
1557 double cost_per_byte_ms = 0.0; 1563 double cost_per_byte_ms = 0.0;
1558 if (copied_bytes > 0) { 1564 if (copied_bytes > 0) {
1559 cost_per_byte_ms = obj_copy_time / (double) copied_bytes; 1565 cost_per_byte_ms = obj_copy_time / (double) copied_bytes;