< prev index next >

src/hotspot/share/gc/g1/g1CollectedHeap.cpp

Print this page
rev 51979 : imported patch 8071913-almost-done
rev 51980 : [mq]: 8071913-alternate


2652     g1h->set_humongous_reclaim_candidate(rindex, is_candidate);
2653     if (is_candidate) {
2654       _candidate_humongous++;
2655       g1h->register_humongous_region_with_cset(rindex);
2656       // Is_candidate already filters out humongous object with large remembered sets.
2657       // If we have a humongous object with a few remembered sets, we simply flush these
2658       // remembered set entries into the DCQS. That will result in automatic
2659       // re-evaluation of their remembered set entries during the following evacuation
2660       // phase.
2661       if (!r->rem_set()->is_empty()) {
2662         guarantee(r->rem_set()->occupancy_less_or_equal_than(G1RSetSparseRegionEntries),
2663                   "Found a not-small remembered set here. This is inconsistent with previous assumptions.");
2664         G1CardTable* ct = g1h->card_table();
2665         HeapRegionRemSetIterator hrrs(r->rem_set());
2666         size_t card_index;
2667         while (hrrs.has_next(card_index)) {
2668           jbyte* card_ptr = (jbyte*)ct->byte_for_index(card_index);
2669           // The remembered set might contain references to already freed
2670           // regions. Filter out such entries to avoid failing card table
2671           // verification.
2672           if (g1h->is_in_closed_subset(ct->addr_for(card_ptr))) {


2673             if (*card_ptr != G1CardTable::dirty_card_val()) {
2674               *card_ptr = G1CardTable::dirty_card_val();
2675               _dcq.enqueue(card_ptr);
2676             }
2677           }
2678         }
2679         assert(hrrs.n_yielded() == r->rem_set()->occupied(),
2680                "Remembered set hash maps out of sync, cur: " SIZE_FORMAT " entries, next: " SIZE_FORMAT " entries",
2681                hrrs.n_yielded(), r->rem_set()->occupied());
2682         // We should only clear the card based remembered set here as we will not
2683         // implicitly rebuild anything else during eager reclaim. Note that at the moment
2684         // (and probably never) we do not enter this path if there are other kind of
2685         // remembered sets for this region.
2686         r->rem_set()->clear_locked(true /* only_cardset */);
2687         // Clear_locked() above sets the state to Empty. However we want to continue
2688         // collecting remembered set entries for humongous regions that were not
2689         // reclaimed.
2690         r->rem_set()->set_state_complete();
2691       }
2692       assert(r->rem_set()->is_empty(), "At this point any humongous candidate remembered set must be empty.");
2693     }
2694     _total_humongous++;
2695 
2696     return false;
2697   }
2698 
2699   size_t total_humongous() const { return _total_humongous; }
2700   size_t candidate_humongous() const { return _candidate_humongous; }
2701 




2652     g1h->set_humongous_reclaim_candidate(rindex, is_candidate);
2653     if (is_candidate) {
2654       _candidate_humongous++;
2655       g1h->register_humongous_region_with_cset(rindex);
2656       // Is_candidate already filters out humongous object with large remembered sets.
2657       // If we have a humongous object with a few remembered sets, we simply flush these
2658       // remembered set entries into the DCQS. That will result in automatic
2659       // re-evaluation of their remembered set entries during the following evacuation
2660       // phase.
2661       if (!r->rem_set()->is_empty()) {
2662         guarantee(r->rem_set()->occupancy_less_or_equal_than(G1RSetSparseRegionEntries),
2663                   "Found a not-small remembered set here. This is inconsistent with previous assumptions.");
2664         G1CardTable* ct = g1h->card_table();
2665         HeapRegionRemSetIterator hrrs(r->rem_set());
2666         size_t card_index;
2667         while (hrrs.has_next(card_index)) {
2668           jbyte* card_ptr = (jbyte*)ct->byte_for_index(card_index);
2669           // The remembered set might contain references to already freed
2670           // regions. Filter out such entries to avoid failing card table
2671           // verification.
2672           if (!g1h->is_in_closed_subset(ct->addr_for(card_ptr))) {
2673             continue;
2674           }
2675           if (*card_ptr != G1CardTable::dirty_card_val()) {
2676             *card_ptr = G1CardTable::dirty_card_val();
2677             _dcq.enqueue(card_ptr);
2678           }
2679         }




2680         // We should only clear the card based remembered set here as we will not
2681         // implicitly rebuild anything else during eager reclaim. Note that at the moment
2682         // (and probably never) we do not enter this path if there are other kind of
2683         // remembered sets for this region.
2684         r->rem_set()->clear_locked(true /* only_cardset */);
2685         // Clear_locked() above sets the state to Empty. However we want to continue
2686         // collecting remembered set entries for humongous regions that were not
2687         // reclaimed.
2688         r->rem_set()->set_state_complete();
2689       }
2690       assert(r->rem_set()->is_empty(), "At this point any humongous candidate remembered set must be empty.");
2691     }
2692     _total_humongous++;
2693 
2694     return false;
2695   }
2696 
2697   size_t total_humongous() const { return _total_humongous; }
2698   size_t candidate_humongous() const { return _candidate_humongous; }
2699 


< prev index next >