1.1 --- a/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp Mon Feb 01 17:29:01 2010 -0800 1.2 +++ b/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp Tue Feb 02 18:39:50 2010 -0800 1.3 @@ -300,7 +300,23 @@ 1.4 int count; 1.5 jbyte* cached_ptr = add_card_count(card_ptr, &count, defer); 1.6 assert(cached_ptr != NULL, "bad cached card ptr"); 1.7 - assert(!is_young_card(cached_ptr), "shouldn't get a card in young region"); 1.8 + 1.9 + if (is_young_card(cached_ptr)) { 1.10 + // The region containing cached_ptr has been freed during a clean up 1.11 + // pause, reallocated, and tagged as young. 1.12 + assert(cached_ptr != card_ptr, "shouldn't be"); 1.13 + 1.14 + // We've just inserted a new old-gen card pointer into the card count 1.15 + // cache and evicted the previous contents of that count slot. 1.16 + // The evicted card pointer has been determined to be in a young region 1.17 + // and so cannot be the newly inserted card pointer (that will be 1.18 + // in an old region). 1.19 + // The count for newly inserted card will be set to zero during the 1.20 + // insertion, so we don't want to defer the cleaning of the newly 1.21 + // inserted card pointer. 1.22 + assert(*defer == false, "deferring non-hot card"); 1.23 + return NULL; 1.24 + } 1.25 1.26 // The card pointer we obtained from card count cache is not hot 1.27 // so do not store it in the cache; return it for immediate