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

changeset 1523
3fc996d4edd2
parent 1383
89e0543e1737
child 1717
b81f3572f355
     1.1 --- a/src/share/vm/gc_implementation/g1/g1MMUTracker.cpp	Thu Nov 19 10:19:19 2009 -0800
     1.2 +++ b/src/share/vm/gc_implementation/g1/g1MMUTracker.cpp	Thu Nov 19 13:43:25 2009 -0800
     1.3 @@ -86,12 +86,22 @@
     1.4      //   increase the array size (:-)
     1.5      //   remove the oldest entry (this might allow more GC time for
     1.6      //     the time slice than what's allowed)
     1.7 -    //   concolidate the two entries with the minimum gap between them
     1.8 -    //     (this mighte allow less GC time than what's allowed)
     1.9 -    guarantee(0, "array full, currently we can't recover");
    1.10 +    //   consolidate the two entries with the minimum gap between them
    1.11 +    //     (this might allow less GC time than what's allowed)
    1.12 +    guarantee(NOT_PRODUCT(ScavengeALot ||) G1ForgetfulMMUTracker,
    1.13 +              "array full, currently we can't recover unless +G1ForgetfulMMUTracker");
    1.14 +    // In the case where ScavengeALot is true, such overflow is not
    1.15 +    // uncommon; in such cases, we can, without much loss of precision
    1.16 +    // or performance (we are GC'ing most of the time anyway!),
    1.17 +    // simply overwrite the oldest entry in the tracker: this
    1.18 +    // is also the behaviour when G1ForgetfulMMUTracker is enabled.
    1.19 +    _head_index = trim_index(_head_index + 1);
    1.20 +    assert(_head_index == _tail_index, "Because we have a full circular buffer");
    1.21 +    _tail_index = trim_index(_tail_index + 1);
    1.22 +  } else {
    1.23 +    _head_index = trim_index(_head_index + 1);
    1.24 +    ++_no_entries;
    1.25    }
    1.26 -  _head_index = trim_index(_head_index + 1);
    1.27 -  ++_no_entries;
    1.28    _array[_head_index] = G1MMUTrackerQueueElem(start, end);
    1.29  }
    1.30  

mercurial