2654 g1h->set_humongous_reclaim_candidate(rindex, is_candidate);
2655 if (is_candidate) {
2656 _candidate_humongous++;
2657 g1h->register_humongous_region_with_cset(rindex);
2658 // Is_candidate already filters out humongous object with large remembered sets.
2659 // If we have a humongous object with a few remembered sets, we simply flush these
2660 // remembered set entries into the DCQS. That will result in automatic
2661 // re-evaluation of their remembered set entries during the following evacuation
2662 // phase.
2663 if (!r->rem_set()->is_empty()) {
2664 guarantee(r->rem_set()->occupancy_less_or_equal_than(G1RSetSparseRegionEntries),
2665 "Found a not-small remembered set here. This is inconsistent with previous assumptions.");
2666 G1CardTable* ct = g1h->card_table();
2667 HeapRegionRemSetIterator hrrs(r->rem_set());
2668 size_t card_index;
2669 while (hrrs.has_next(card_index)) {
2670 jbyte* card_ptr = (jbyte*)ct->byte_for_index(card_index);
2671 // The remembered set might contain references to already freed
2672 // regions. Filter out such entries to avoid failing card table
2673 // verification.
2674 if (!g1h->is_in_closed_subset(ct->addr_for(card_ptr))) {
2675 continue;
2676 }
2677 if (*card_ptr != G1CardTable::dirty_card_val()) {
2678 *card_ptr = G1CardTable::dirty_card_val();
2679 _dcq.enqueue(card_ptr);
2680 }
2681 }
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
|
2654 g1h->set_humongous_reclaim_candidate(rindex, is_candidate);
2655 if (is_candidate) {
2656 _candidate_humongous++;
2657 g1h->register_humongous_region_with_cset(rindex);
2658 // Is_candidate already filters out humongous object with large remembered sets.
2659 // If we have a humongous object with a few remembered sets, we simply flush these
2660 // remembered set entries into the DCQS. That will result in automatic
2661 // re-evaluation of their remembered set entries during the following evacuation
2662 // phase.
2663 if (!r->rem_set()->is_empty()) {
2664 guarantee(r->rem_set()->occupancy_less_or_equal_than(G1RSetSparseRegionEntries),
2665 "Found a not-small remembered set here. This is inconsistent with previous assumptions.");
2666 G1CardTable* ct = g1h->card_table();
2667 HeapRegionRemSetIterator hrrs(r->rem_set());
2668 size_t card_index;
2669 while (hrrs.has_next(card_index)) {
2670 jbyte* card_ptr = (jbyte*)ct->byte_for_index(card_index);
2671 // The remembered set might contain references to already freed
2672 // regions. Filter out such entries to avoid failing card table
2673 // verification.
2674 if (g1h->is_in_closed_subset(ct->addr_for(card_ptr))) {
2675 if (*card_ptr != G1CardTable::dirty_card_val()) {
2676 *card_ptr = G1CardTable::dirty_card_val();
2677 _dcq.enqueue(card_ptr);
2678 }
2679 }
2680 }
2681 assert(hrrs.n_yielded() == r->rem_set()->occupied(),
2682 "Remembered set hash maps out of sync, cur: " SIZE_FORMAT " entries, next: " SIZE_FORMAT " entries",
2683 hrrs.n_yielded(), r->rem_set()->occupied());
2684 // We should only clear the card based remembered set here as we will not
2685 // implicitly rebuild anything else during eager reclaim. Note that at the moment
2686 // (and probably never) we do not enter this path if there are other kind of
2687 // remembered sets for this region.
2688 r->rem_set()->clear_locked(true /* only_cardset */);
2689 // Clear_locked() above sets the state to Empty. However we want to continue
2690 // collecting remembered set entries for humongous regions that were not
2691 // reclaimed.
2692 r->rem_set()->set_state_complete();
2693 }
2694 assert(r->rem_set()->is_empty(), "At this point any humongous candidate remembered set must be empty.");
2695 }
2696 _total_humongous++;
2697
2698 return false;
2699 }
2700
2701 size_t total_humongous() const { return _total_humongous; }
2702 size_t candidate_humongous() const { return _candidate_humongous; }
2703
|